busybox/archival/libarchive
Denys Vlasenko 3989e5adf4 unlzma: fix erroneous "while" instead of "if". Closes 4682
These parts of the code essentially check whether
stepping back by rep0 goes negative or not.

LZMA SDK from lzma1604.7z has the following in the corresponding places:

... = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)]

Clearly, not loop here.

Technically, "while" here works: if condition is false (because pos
underflowed), it iterates once, adds header.dict_size (a.k.a. dicBufSize),
this makes pos positive but smaller than header.dict_size, and loop exits.

Now we'll just check for negative result of subtraction, which is less code:

function                                             old     new   delta
unpack_lzma_stream                                  2659    2641     -18

(I hope 2 Gbyte+ dictionaries won't be in use soon).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-09 14:02:55 +01:00
..
bz Removes stray empty line from code 2015-07-13 03:25:46 +02:00
unxz Removes stray empty line from code 2015-07-13 03:25:46 +02:00
common.c *: slap on a few ALIGN1/2s where appropriate 2016-04-22 18:09:21 +02:00
data_align.c
data_extract_all.c tar: fix files skipped with --strip_components not resetting selinux context 2015-10-22 13:38:09 +02:00
data_extract_to_command.c libbb: two new functions: wait_for_exitstatus(pid), xfchdir(fd) 2016-04-01 22:12:44 +02:00
data_extract_to_stdout.c
data_skip.c
decompress_bunzip2.c libarchive: add capability to unpack to mem.buffer 2014-12-07 00:44:00 +01:00
decompress_gunzip.c libarchive: fix xmalloc_open_zipped_read_close() on NOMMU 2016-06-20 11:06:42 +02:00
decompress_uncompress.c Removes stray empty line from code 2015-07-13 03:25:46 +02:00
decompress_unlzma.c unlzma: fix erroneous "while" instead of "if". Closes 4682 2017-01-09 14:02:55 +01:00
decompress_unxz.c libarchive: fix xmalloc_open_zipped_read_close() on NOMMU 2016-06-20 11:06:42 +02:00
filter_accept_all.c
filter_accept_list_reassign.c dpkg: update supported compression methods 2015-01-30 15:15:38 +01:00
filter_accept_list.c
filter_accept_reject_list.c trivial small speed optimization 2012-06-22 15:54:05 +02:00
find_list_entry.c
get_header_ar.c ar: better comment 2013-09-10 16:27:08 +02:00
get_header_cpio.c cpio: implement -R/--owner 2015-10-16 17:24:46 +02:00
get_header_tar_bz2.c libarchive: add capability to unpack to mem.buffer 2014-12-07 00:44:00 +01:00
get_header_tar_gz.c libarchive: add capability to unpack to mem.buffer 2014-12-07 00:44:00 +01:00
get_header_tar_lzma.c libarchive: add capability to unpack to mem.buffer 2014-12-07 00:44:00 +01:00
get_header_tar_xz.c dpkg: update supported compression methods 2015-01-30 15:15:38 +01:00
get_header_tar.c tar: handle pax-encoded utf8 filenames and link names. Closes 9406 2016-11-11 17:56:45 +01:00
header_list.c
header_skip.c
header_verbose_list.c
init_handle.c cpio: fix restoration of file ownership, closes 9306 2016-10-12 20:56:46 +02:00
Kbuild.src unzip: optional support for xz 2017-01-09 11:12:01 +01:00
liblzo.h lzop: add overflow check 2014-06-30 10:14:34 +02:00
lzo1x_1.c
lzo1x_1o.c
lzo1x_9x.c Removes stray empty line from code 2015-07-13 03:25:46 +02:00
lzo1x_c.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
lzo1x_d.c lzop: add overflow check 2014-06-30 10:14:34 +02:00
open_transformer.c libarchive: fix xmalloc_open_zipped_read_close() 2016-06-21 02:04:16 +02:00
seek_by_jump.c
seek_by_read.c
unpack_ar_archive.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00
unsafe_prefix.c libbb: introduce and use is_prefixed_with() 2015-03-12 17:48:34 +01:00