Skip to content

Commit 36e369e

Browse files
committed
Note that the len2 argument of crc_combine*() must be non-negative.
If it is negative, then the code will enter an infinite loop.
1 parent 60c3198 commit 36e369e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zlib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,14 +1758,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
17581758
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
17591759
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
17601760
check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
1761-
len2.
1761+
len2. len2 must be non-negative.
17621762
*/
17631763

17641764
/*
17651765
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
17661766
17671767
Return the operator corresponding to length len2, to be used with
1768-
crc32_combine_op().
1768+
crc32_combine_op(). len2 must be non-negative.
17691769
*/
17701770

17711771
ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);

0 commit comments

Comments
 (0)