Skip to content

Commit

Permalink
fixed test error
Browse files Browse the repository at this point in the history
could trigger %0 on exceptional circumstances
due to wrong buffer size parameter.
  • Loading branch information
Cyan4973 committed Aug 15, 2019
1 parent dfad84c commit fdf2ef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/frametest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} } }
Expand Down

0 comments on commit fdf2ef5

Please sign in to comment.