diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-03 23:41:11 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-03 23:41:11 +0100 |
commit | d6459685c1a93785d0bdf94e16834a6d4c54842f (patch) | |
tree | 94b43b0f6db1f4e89081c811627e114882fbc542 | |
parent | 2d3253d1f93fbffb62c7521d41eed0102747d949 (diff) | |
download | busybox-w32-d6459685c1a93785d0bdf94e16834a6d4c54842f.tar.gz busybox-w32-d6459685c1a93785d0bdf94e16834a6d4c54842f.tar.bz2 busybox-w32-d6459685c1a93785d0bdf94e16834a6d4c54842f.zip |
tar: fix problem handling tarballs with chksums prepended by spaces
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index b8d7648ec..1f799277b 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c | |||
@@ -274,7 +274,8 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle) | |||
274 | bb_error_msg_and_die("invalid tar header checksum"); | 274 | bb_error_msg_and_die("invalid tar header checksum"); |
275 | } | 275 | } |
276 | } | 276 | } |
277 | sum = xstrtoul(tar.chksum, 8); | 277 | /* don't use xstrtoul, tar.chksum may have leading spaces */ |
278 | sum = strtoul(tar.chksum, NULL, 8); | ||
278 | if (sum_u != sum IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) { | 279 | if (sum_u != sum IF_FEATURE_TAR_OLDSUN_COMPATIBILITY(&& sum_s != sum)) { |
279 | bb_error_msg_and_die("invalid tar header checksum"); | 280 | bb_error_msg_and_die("invalid tar header checksum"); |
280 | } | 281 | } |