home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.utils.bug
- Path: sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cc.uow.EDU.AU!amorton
- From: amorton@cc.uow.EDU.AU (andrew morton)
- Subject: Bug in tar-1.11?
- Message-ID: <199211102308.AA13985@wampyr.cc.uow.edu.au>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Wed, 11 Nov 1992 15:08:52 GMT
- Approved: bug-gnu-utils@prep.ai.mit.edu
- Lines: 28
-
- In tar-1.11, extract.c, line 343 or thereabouts, we have
-
-
- /*
- * Kludge alert. NAME is assigned to header.name
- * because during the extraction, the space that
- * contains the header will get scribbled on, and
- * the name will get munged, so any error messages
- * that happen to contain the filename will look
- * REAL interesting unless we do this.
- */
- namelen = strlen(skipcrud + current_file_name);
- name = (char *) malloc((sizeof(char)) * namelen);
- bcopy(skipcrud+current_file_name, name, namelen);
- size = hstat.st_size;
- extract_sparse_file(fd, &size, hstat.st_size, name);
-
- Is it not the case that 'name' is not null-terminated?
- Don't we want:
-
- namelen = strlen(skipcrud + current_file_name);
- name = (char *) malloc((sizeof(char)) * (namelen + 1));
- bcopy(skipcrud+current_file_name, name, namelen);
- name[namelen] = '\0';
- size = hstat.st_size;
- extract_sparse_file(fd, &size, hstat.st_size, name);
-
-
-