]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
IBM zSystems: Fix calling deflateBound() before deflateInit()
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 19 Apr 2023 14:03:18 +0000 (16:03 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 25 Apr 2023 10:07:31 +0000 (12:07 +0200)
commitfc49c98d1f47b4f041e0cc2668fa7b66c13a6377
tree52d40a981d2acdd6d856fe15fc34c3787ba9cebe
parent1ae7b0545dd49d32bf64f874c141e706c26cc8a6
IBM zSystems: Fix calling deflateBound() before deflateInit()

Even though zlib officialy forbids calling deflateBound() before
deflateInit(), Firefox does this anyway, and it happens to work [1],
but unfortunately not with DFLTCC [2], because the DFLTCC code assumes
that the deflate state is allocated, and segfaults when it isn't.

Bow down before Hyrum's Law and add deflateStateCheck() to
DEFLATE_BOUND_ADJUST_COMPLEN().

Extend the deflate_bound test accordingly.

[1] https://searchfox.org/mozilla-esr102/source/dom/script/ScriptCompression.cpp#97
[2] https://bugzilla.suse.com/show_bug.cgi?id=1210593
arch/s390/dfltcc_deflate.h
test/test_deflate_bound.cc