Fix bounds check in ZSTD_storeSeq()
This commit is contained in:
parent
67b1f5fc72
commit
fde217df04
@ -361,8 +361,8 @@ MEM_STATIC void ZSTD_storeSeq(seqStore_t* seqStorePtr, size_t litLength, const B
|
||||
assert(seqStorePtr->maxNbLit <= 128 KB);
|
||||
assert(seqStorePtr->lit + litLength <= seqStorePtr->litStart + seqStorePtr->maxNbLit);
|
||||
/* We are guaranteed at least 8 bytes of literals space because of HASH_READ_SIZE. */
|
||||
assert(litLimit - literals >= HASH_READ_SIZE);
|
||||
if (litLimit - literals >= WILDCOPY_OVERLENGTH)
|
||||
assert(literals + litLength + HASH_READ_SIZE <= litLimit);
|
||||
if (literals + litLength + WILDCOPY_OVERLENGTH <= litLimit)
|
||||
ZSTD_wildcopy(seqStorePtr->lit, literals, (ptrdiff_t)litLength, ZSTD_no_overlap);
|
||||
else
|
||||
ZSTD_wildcopy8(seqStorePtr->lit, literals, (ptrdiff_t)litLength);
|
||||
|
Loading…
Reference in New Issue
Block a user