diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-05-11 16:55:16 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-05-11 16:55:16 +0200 |
| commit | bdb540e04f3eb52c4cd790c45c5d8efd6d749c70 (patch) | |
| tree | aff390bd9d45788afe923101adbea75e9b1f2419 | |
| parent | 778efe37eed03de6e194a746925f1160181ff587 (diff) | |
| download | busybox-w32-bdb540e04f3eb52c4cd790c45c5d8efd6d749c70.tar.gz busybox-w32-bdb540e04f3eb52c4cd790c45c5d8efd6d749c70.tar.bz2 busybox-w32-bdb540e04f3eb52c4cd790c45c5d8efd6d749c70.zip | |
tar: do not try to decode GNU extended headers as pax headers
function old new delta
get_header_tar 1736 1692 -44
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | archival/libarchive/get_header_tar.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/archival/libarchive/get_header_tar.c b/archival/libarchive/get_header_tar.c index 2dbcdb50c..fb68673b9 100644 --- a/archival/libarchive/get_header_tar.c +++ b/archival/libarchive/get_header_tar.c | |||
| @@ -350,7 +350,14 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
| 350 | case '6': | 350 | case '6': |
| 351 | file_header->mode |= S_IFIFO; | 351 | file_header->mode |= S_IFIFO; |
| 352 | goto size0; | 352 | goto size0; |
| 353 | case 'g': /* pax global header */ | ||
| 354 | case 'x': { /* pax extended header */ | ||
| 355 | if ((uoff_t)file_header->size > 0xfffff) /* paranoia */ | ||
| 356 | goto skip_ext_hdr; | ||
| 357 | process_pax_hdr(archive_handle, file_header->size, (tar.typeflag == 'g')); | ||
| 358 | goto again_after_align; | ||
| 353 | #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS | 359 | #if ENABLE_FEATURE_TAR_GNU_EXTENSIONS |
| 360 | /* See http://www.gnu.org/software/tar/manual/html_node/Extensions.html */ | ||
| 354 | case 'L': | 361 | case 'L': |
| 355 | /* free: paranoia: tar with several consecutive longnames */ | 362 | /* free: paranoia: tar with several consecutive longnames */ |
| 356 | free(p_longname); | 363 | free(p_longname); |
| @@ -370,18 +377,17 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
| 370 | archive_handle->offset += file_header->size; | 377 | archive_handle->offset += file_header->size; |
| 371 | /* return get_header_tar(archive_handle); */ | 378 | /* return get_header_tar(archive_handle); */ |
| 372 | goto again; | 379 | goto again; |
| 373 | case 'D': /* GNU dump dir */ | 380 | /* |
| 374 | case 'M': /* Continuation of multi volume archive */ | 381 | * case 'S': // Sparse file |
| 375 | case 'N': /* Old GNU for names > 100 characters */ | 382 | * Was seen in the wild. Not supported (yet?). |
| 376 | case 'S': /* Sparse file */ | 383 | * See https://www.gnu.org/software/tar/manual/html_section/tar_92.html |
| 377 | case 'V': /* Volume header */ | 384 | * for the format. (An "Old GNU Format" was seen, not PAX formats). |
| 385 | */ | ||
| 386 | // case 'D': /* GNU dump dir */ | ||
| 387 | // case 'M': /* Continuation of multi volume archive */ | ||
| 388 | // case 'N': /* Old GNU for names > 100 characters */ | ||
| 389 | // case 'V': /* Volume header */ | ||
| 378 | #endif | 390 | #endif |
| 379 | case 'g': /* pax global header */ | ||
| 380 | case 'x': { /* pax extended header */ | ||
| 381 | if ((uoff_t)file_header->size > 0xfffff) /* paranoia */ | ||
| 382 | goto skip_ext_hdr; | ||
| 383 | process_pax_hdr(archive_handle, file_header->size, (tar.typeflag == 'g')); | ||
| 384 | goto again_after_align; | ||
| 385 | } | 391 | } |
| 386 | skip_ext_hdr: | 392 | skip_ext_hdr: |
| 387 | { | 393 | { |
