]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Note that the len2 argument of crc_combine*() must be non-negative.
authorMark Adler <madler@alumni.caltech.edu>
Mon, 29 Jan 2024 03:39:17 +0000 (19:39 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 7 Feb 2024 18:15:56 +0000 (19:15 +0100)
If it is negative, then the code will enter an infinite loop.

madler/zlib#36e369e1a54b35a978dc584496af69a07ec2d71a

zlib-ng.h.in
zlib.h.in

index 342b240afb6534185c2f685eda0168b41cc28793..a2117b5c3756693b32889c70a84208c4a9d8dbdd 100644 (file)
@@ -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
index eabb94afe09ccbd2a939f020d2af4983d7581e9c..1b49311649fb46461f67d45432efd16cad134a75 100644 (file)
--- 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,