diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2024-01-11 12:53:58 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2024-01-13 22:30:30 -0800 |
commit | 36e369e1a54b35a978dc584496af69a07ec2d71a (patch) | |
tree | 949babf0593a9cd9a7ac1ce06652f2148b0b6399 | |
parent | 60c31985ecdc2b40873564867e1ad2aef0b88697 (diff) | |
download | zlib-36e369e1a54b35a978dc584496af69a07ec2d71a.tar.gz zlib-36e369e1a54b35a978dc584496af69a07ec2d71a.tar.bz2 zlib-36e369e1a54b35a978dc584496af69a07ec2d71a.zip |
Note that the len2 argument of crc_combine*() must be non-negative.
If it is negative, then the code will enter an infinite loop.
-rw-r--r-- | zlib.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1758,14 +1758,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); | |||
1758 | seq1 and seq2 with lengths len1 and len2, CRC-32 check values were | 1758 | seq1 and seq2 with lengths len1 and len2, CRC-32 check values were |
1759 | calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 | 1759 | calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 |
1760 | check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and | 1760 | check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and |
1761 | len2. | 1761 | len2. len2 must be non-negative. |
1762 | */ | 1762 | */ |
1763 | 1763 | ||
1764 | /* | 1764 | /* |
1765 | ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); | 1765 | ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); |
1766 | 1766 | ||
1767 | Return the operator corresponding to length len2, to be used with | 1767 | Return the operator corresponding to length len2, to be used with |
1768 | crc32_combine_op(). | 1768 | crc32_combine_op(). len2 must be non-negative. |
1769 | */ | 1769 | */ |
1770 | 1770 | ||
1771 | ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); | 1771 | ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); |