bzip2: fix two crashes on corrupted archives
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 8 Apr 2018 18:02:01 +0000 (20:02 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 8 Apr 2018 18:05:04 +0000 (20:05 +0200)
commit38ccd6af8abbafff98d458a1c62909acfc09a514
tree1a4158db5c7e5e98111ff99d4a9078d93b4ccfcc
parent8e2174e9bd836e53c8b9c6e00d1bc6e2a718686e
bzip2: fix two crashes on corrupted archives

As it turns out, longjmp'ing into freed stack is not healthy...

function                                             old     new   delta
unpack_usage_messages                                  -      97     +97
unpack_bz2_stream                                    369     409     +40
get_next_block                                      1667    1677     +10
get_bits                                             156     155      -1
start_bunzip                                         212     183     -29
bb_show_usage                                        181     120     -61
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/3 up/down: 147/-91)            Total: 56 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/decompress_bunzip2.c
archival/libarchive/decompress_gunzip.c
coreutils/test.c
include/bb_archive.h
libbb/appletlib.c
miscutils/bbconfig.c
shell/ash.c
testsuite/bunzip2.tests
testsuite/bz2_issue_11.bz2 [new file with mode: 0644]
testsuite/bz2_issue_12.bz2 [new file with mode: 0644]