From: Mark Adler Date: Mon, 29 Jan 2024 03:39:17 +0000 (-0800) Subject: Note that the len2 argument of crc_combine*() must be non-negative. X-Git-Tag: 2.2.0~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b8e7f616e404e2a0655bf7df093d8559adb6101;p=thirdparty%2Fzlib-ng.git Note that the len2 argument of crc_combine*() must be non-negative. If it is negative, then the code will enter an infinite loop. madler/zlib#36e369e1a54b35a978dc584496af69a07ec2d71a --- diff --git a/zlib-ng.h.in b/zlib-ng.h.in index 342b240a..a2117b5c 100644 --- a/zlib-ng.h.in +++ b/zlib-ng.h.in @@ -1759,7 +1759,7 @@ uint32_t zng_crc32_combine(uint32_t crc1, uint32_t crc2, z_off64_t len2); seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ Z_EXTERN Z_EXPORT @@ -1767,7 +1767,7 @@ uint32_t zng_crc32_combine_gen(z_off64_t len2); /* Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ Z_EXTERN Z_EXPORT diff --git a/zlib.h.in b/zlib.h.in index eabb94af..1b493116 100644 --- a/zlib.h.in +++ b/zlib.h.in @@ -1732,14 +1732,14 @@ Z_EXTERN unsigned long Z_EXPORT crc32_combine(unsigned long crc1, unsigned long seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* Z_EXTERN unsigned long Z_EXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ Z_EXTERN unsigned long Z_EXPORT crc32_combine_op(unsigned long crc1, unsigned long crc2,