Thread View: gnu.utils.bug
1 messages
1 total messages
Started by andrew morton
Wed, 11 Nov 1992 15:08
Bug in tar-1.11?
Author: andrew morton
Date: Wed, 11 Nov 1992 15:08
Date: Wed, 11 Nov 1992 15:08
26 lines
1435 bytes
1435 bytes
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);
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads