Skip to content

Commit

Permalink
Note that the len2 argument of crc_combine*() must be non-negative.
Browse files Browse the repository at this point in the history
If it is negative, then the code will enter an infinite loop.
  • Loading branch information
madler committed Jan 14, 2024
1 parent 60c3198 commit 36e369e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 36e369e

Please sign in to comment.