busybox/archival
Peter Korsgaard 2a053a2430 ar: read_num(): fix reading fields using the entire width
ar fields are fixed length text strings (padded with spaces). Ensure
bb_strtou doesn't read past the field in case the full width is used.

The fields are only read once, so the simplest/smallest solution to me
seems to be to just pass the length to read_num() and then zero terminate
the string before passing it to bb_strtou. This does mean that the fields
MUST be read in reverse order, so some minor reshuffling was needed.

Bloat-o-meter:
function                                             old     new   delta
get_header_ar                                        394     414     +20
read_num                                              29      36      +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 27/0)               Total: 27 bytes

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-09-10 16:22:12 +02:00
..
libarchive ar: read_num(): fix reading fields using the entire width 2013-09-10 16:22:12 +02:00
ar.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
bbunzip_test2.sh
bbunzip_test3.sh
bbunzip_test.sh
bbunzip.c unpackers: by users' request, print compression percentage if -v and DESKTOP 2013-07-30 05:41:11 +02:00
bzip2.c update seamless uncompression code 2012-03-06 16:27:48 +01:00
Config.src Move seamless .Z support into unpack_gz_stream 2012-03-06 16:32:06 +01:00
cpio.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
dpkg_deb.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
dpkg.c whitespace fixes. no code changes 2013-01-14 01:34:48 +01:00
gzip.c whitespace fixes. no code changes 2013-01-14 01:34:48 +01:00
Kbuild.src rename archival/libunarchive -> archival/libarchive; move bz/ into it 2010-11-03 02:38:31 +01:00
lzop.c archival: note implicit dependencies between lzop & bbunzip 2013-03-03 00:48:53 -05:00
rpm2cpio.c tar,rpm2cpio: check that child decompressor did not error out 2012-03-06 16:33:42 +01:00
rpm.c rpm: unmap rpm file before working with next one 2013-02-20 16:01:48 +01:00
rpm.h *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
tar.c tar: fix tar -T to add entries in the exact order as the input list 2013-08-15 12:19:29 +02:00
unzip.c unzip: survive lack of CDF on non-streaming zip files 2013-07-21 02:31:08 +02:00