fixed new MIN_CBLOCK_SIZE

This commit is contained in:
Yann Collet
2016-01-25 17:26:01 +01:00
parent 3742219b4e
commit bc4c8aa4b7
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -351,14 +351,14 @@ size_t ZSTD_decodeLiteralsBlock(ZSTD_DCtx* dctx,
break;
}
if (litSize > srcSize-11) /* risk of reading beyond src buffer with wildcopy */
if (litSize+WILDCOPY_OVERLENGTH > srcSize) /* risk reading beyond src buffer with wildcopy */
{
if (litSize > srcSize-lhSize) return ERROR(corruption_detected);
memcpy(dctx->litBuffer, istart+lhSize, litSize);
dctx->litPtr = dctx->litBuffer;
dctx->litBufSize = BLOCKSIZE+8;
dctx->litSize = litSize;
return litSize+lhSize;
return lhSize+litSize;
}
/* direct reference into compressed stream */
dctx->litPtr = istart+lhSize;