tar: improve comments, add FIXMEs. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
049775b2ef
commit
b198e9aa93
@ -332,7 +332,6 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set bits 12-15 of the files mode */
|
/* Set bits 12-15 of the files mode */
|
||||||
/* (typeflag was not trashed because chksum does not use getOctal) */
|
|
||||||
switch (tar_typeflag) {
|
switch (tar_typeflag) {
|
||||||
case '1': /* hardlink */
|
case '1': /* hardlink */
|
||||||
/* we mark hardlinks as regular files with zero size and a link name */
|
/* we mark hardlinks as regular files with zero size and a link name */
|
||||||
@ -390,6 +389,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
|||||||
/* free: paranoia: tar with several consecutive longnames */
|
/* free: paranoia: tar with several consecutive longnames */
|
||||||
free(p_longname);
|
free(p_longname);
|
||||||
/* For paranoia reasons we allocate extra NUL char */
|
/* For paranoia reasons we allocate extra NUL char */
|
||||||
|
//FIXME: disallow huge sizes:
|
||||||
p_longname = xzalloc(file_header->size + 1);
|
p_longname = xzalloc(file_header->size + 1);
|
||||||
/* We read ASCIZ string, including NUL */
|
/* We read ASCIZ string, including NUL */
|
||||||
xread(archive_handle->src_fd, p_longname, file_header->size);
|
xread(archive_handle->src_fd, p_longname, file_header->size);
|
||||||
@ -400,6 +400,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
|||||||
goto again;
|
goto again;
|
||||||
case 'K':
|
case 'K':
|
||||||
free(p_linkname);
|
free(p_linkname);
|
||||||
|
//FIXME: disallow huge sizes:
|
||||||
p_linkname = xzalloc(file_header->size + 1);
|
p_linkname = xzalloc(file_header->size + 1);
|
||||||
xread(archive_handle->src_fd, p_linkname, file_header->size);
|
xread(archive_handle->src_fd, p_linkname, file_header->size);
|
||||||
archive_handle->offset += file_header->size;
|
archive_handle->offset += file_header->size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user