fixed test error
authorYann Collet <cyan@fb.com>
Thu, 15 Aug 2019 11:59:59 +0000 (13:59 +0200)
committerYann Collet <cyan@fb.com>
Thu, 15 Aug 2019 11:59:59 +0000 (13:59 +0200)
could trigger %0 on exceptional circumstances
due to wrong buffer size parameter.

tests/frametest.c

index 91813bb..1b932e4 100644 (file)
@@ -1059,7 +1059,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
                     size_t const mask = (1<<nbBits) - 1;
                     size_t const rNoiseLength = (FUZ_rand(&randState) & mask) + 1;
                     size_t const noiseLength = MIN(rNoiseLength, cSize-pos);
-                    size_t const noiseStart = FUZ_rand(&randState) % (COMPRESSIBLE_NOISE_LENGTH - noiseLength);
+                    size_t const noiseStart = FUZ_rand(&randState) % (CNBufferLength - noiseLength);
                     memcpy((BYTE*)compressedBuffer + pos, (const char*)CNBuffer + noiseStart, noiseLength);
                     pos += noiseLength;
         }   }   }