From 36e369e1a54b35a978dc584496af69a07ec2d71a Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Thu, 11 Jan 2024 12:53:58 -0800 Subject: [PATCH] Note that the len2 argument of crc_combine*() must be non-negative. If it is negative, then the code will enter an infinite loop. --- zlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zlib.h b/zlib.h index b3e19fce8..39991a418 100644 --- a/zlib.h +++ b/zlib.h @@ -1758,14 +1758,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_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. */ /* ZEXTERN uLong ZEXPORT 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. */ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);