]> git.kaiwu.me - haproxy.git/commit
IMPORT: slz: fix the adler32 accumulators signedness on 32-bit
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 11 Aug 2026 16:09:33 +0000 (18:09 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 12 Aug 2026 07:14:07 +0000 (09:14 +0200)
commit1fd60f11581222fc0be13b9d9e38f41c9062ca3d
tree58e03704bbff47e3aa91e58a319547af6a869b02
parent68d8708da3f25f1ccff4a371e2ff20bd706c3b89
IMPORT: slz: fix the adler32 accumulators signedness on 32-bit

slz_adler32_block() unfortunately uses a signed long as the crc accumulator
instead of an unsigned one, meaning that for CRC values where the 32th bit
is set on 32-bit machines, the right shift will drag sign bits and corrupt
it. This only affects zlib streams on 32-bit systems (rfc1950) and has
been there for a very long time, showing that the zlib format is really
not much used in target environments.

The fix is trivial, just change the accumulators to unsigned long.

This is libslz upstream commit 912a707525fd2d6a63c9884ef02f69e7379c304c
src/slz_common.c