mirror of
https://github.com/facebook/zstd
synced 2026-08-22 22:32:07 -04:00
deal safely with short inputs in ZSTD_ldm_generateSequences
The fuzzer CI found this bug.
This commit is contained in:
parent
9f327c02fd
commit
874a590e5c
1 changed files with 3 additions and 0 deletions
|
|
@ -328,6 +328,9 @@ static size_t ZSTD_ldm_generateSequences_internal(
|
|||
} candidates[LDM_LOOKAHEAD_SPLITS];
|
||||
unsigned numSplits;
|
||||
|
||||
if (srcSize < minMatchLength)
|
||||
return iend - anchor;
|
||||
|
||||
/* Initialize the rolling hash state with the first minMatchLength bytes */
|
||||
ZSTD_ldm_gear_init(&hashState, params);
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue