aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-10-08 19:34:20 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-10-08 19:34:20 +0200
commitb198e9aa934386531b2bc1fd0291ed3cc6beaf96 (patch)
tree13252487b9e45b2d633fbcbb82369952a852bd04 /archival
parent049775b2ef39a20dc08a6bf89e2831e8422f7363 (diff)
downloadbusybox-w32-b198e9aa934386531b2bc1fd0291ed3cc6beaf96.tar.gz
busybox-w32-b198e9aa934386531b2bc1fd0291ed3cc6beaf96.tar.bz2
busybox-w32-b198e9aa934386531b2bc1fd0291ed3cc6beaf96.zip
tar: improve comments, add FIXMEs. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival')
-rw-r--r--archival/libarchive/get_header_tar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c
index 2ab3c04b8..a142290ff 100644
--- a/archival/libarchive/get_header_tar.c
+++ b/archival/libarchive/get_header_tar.c
@@ -332,7 +332,6 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
332 } 332 }
333 333
334 /* Set bits 12-15 of the files mode */ 334 /* Set bits 12-15 of the files mode */
335 /* (typeflag was not trashed because chksum does not use getOctal) */
336 switch (tar_typeflag) { 335 switch (tar_typeflag) {
337 case '1': /* hardlink */ 336 case '1': /* hardlink */
338 /* we mark hardlinks as regular files with zero size and a link name */ 337 /* we mark hardlinks as regular files with zero size and a link name */
@@ -341,7 +340,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
341 * ... For tar archives written by pre POSIX.1-1988 340 * ... For tar archives written by pre POSIX.1-1988
342 * implementations, the size field usually contains the size of 341 * implementations, the size field usually contains the size of
343 * the file and needs to be ignored as no data may follow this 342 * the file and needs to be ignored as no data may follow this
344 * header type. For POSIX.1- 1988 compliant archives, the size 343 * header type. For POSIX.1-1988 compliant archives, the size
345 * field needs to be 0. For POSIX.1-2001 compliant archives, 344 * field needs to be 0. For POSIX.1-2001 compliant archives,
346 * the size field may be non zero, indicating that file data is 345 * the size field may be non zero, indicating that file data is
347 * included in the archive. 346 * included in the archive.
@@ -390,6 +389,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
390 /* free: paranoia: tar with several consecutive longnames */ 389 /* free: paranoia: tar with several consecutive longnames */
391 free(p_longname); 390 free(p_longname);
392 /* For paranoia reasons we allocate extra NUL char */ 391 /* For paranoia reasons we allocate extra NUL char */
392//FIXME: disallow huge sizes:
393 p_longname = xzalloc(file_header->size + 1); 393 p_longname = xzalloc(file_header->size + 1);
394 /* We read ASCIZ string, including NUL */ 394 /* We read ASCIZ string, including NUL */
395 xread(archive_handle->src_fd, p_longname, file_header->size); 395 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)
400 goto again; 400 goto again;
401 case 'K': 401 case 'K':
402 free(p_linkname); 402 free(p_linkname);
403//FIXME: disallow huge sizes:
403 p_linkname = xzalloc(file_header->size + 1); 404 p_linkname = xzalloc(file_header->size + 1);
404 xread(archive_handle->src_fd, p_linkname, file_header->size); 405 xread(archive_handle->src_fd, p_linkname, file_header->size);
405 archive_handle->offset += file_header->size; 406 archive_handle->offset += file_header->size;