]> git.ipfire.org Git - thirdparty/zlib-ng.git/commit
IBM zSystems DFLTCC: Do not update strm.adler for raw streams
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 22 Dec 2022 09:34:57 +0000 (10:34 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 9 Jan 2023 14:09:18 +0000 (15:09 +0100)
commit2ff9398fded2f1bec8b42c0e27002de9f80bbe74
tree7948e15b834fed6ff4d34b0837a0d7b244b4a082
parentc4e7e231c80f1182e0e85301e4ccc8b17457e02e
IBM zSystems DFLTCC: Do not update strm.adler for raw streams

Commit d38dd9240f2d ("IBM Z DFLTCC: Fix updating strm.adler with
inflate()") broke libxml2, as can be seen with the repro from [1]:

    $ echo "<a></a>" | gzip >file.xml.gz
    $ python3 -c 'import libxml2; libxml2.parseFile("file.xml.gz")'
    file.xml.gz:1: parser error : Document is empty

This is because libxml2 expects strm.adler to be untouched for raw
streams.

Fix this and a similar issue in deflate by adding state->wrap checks.
Add tests.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2155328
[2] https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.10.3/xzlib.c#L607
arch/s390/dfltcc_deflate.c
arch/s390/dfltcc_inflate.c
test/CMakeLists.txt
test/test_deflate_header.cc
test/test_raw.cc [new file with mode: 0644]