]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
Restore hash_head != 0 checks
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 18 Mar 2021 13:54:46 +0000 (14:54 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 20 Mar 2021 22:35:48 +0000 (23:35 +0100)
commitf426ac9db3e0ce35c83838aa8eaf248b2b624d0a
treea79814c5409f3dacff828d8c72f1df03e686bf7b
parentbc33b26ca5391eb6b2c952cd032920033be27a53
Restore hash_head != 0 checks

Commit bc5915e2dec7 ("Fixed unsigned integer overflow ASAN error when
hash_head > s->strstart.") removed hash_head != 0 checks in fast,
medium and slow deflate, because it improved performance [1].

Unfortunately, the attached test started failing after that.
Apparently, as the comments suggest, the code implicitly relies on
matches with the beginning of the window being skipped. So restore the
check.

[1] https://github.com/zlib-ng/zlib-ng/pull/772#issuecomment-710760300
CMakeLists.txt
deflate_fast.c
deflate_medium.c
deflate_slow.c
test/hash_head_0.c [new file with mode: 0644]