mirror of
https://github.com/lz4/lz4.git
synced 2024-11-30 13:26:08 +08:00
fixed test error
could trigger %0 on exceptional circumstances due to wrong buffer size parameter.
This commit is contained in:
parent
dfad84ca3e
commit
fdf2ef5809
@ -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;
|
||||
} } }
|
||||
|
Loading…
Reference in New Issue
Block a user