Merge pull request #2075 from bimbashrestha/dict_fuzzer_ref

[bug] handling case where prefix is NULL or 0 sized in refPrefix_advanced
This commit is contained in:
Bimba Shrestha authored and GitHub committed 2020-04-07 17:37:19 -05:00
commit c0d4b2b5a3
2 files changed
+21 -8

No files matched your search

+5 -3
View File
@@ -945,9 +945,11 @@ size_t ZSTD_CCtx_refPrefix_advanced(
{
RETURN_ERROR_IF(cctx->streamStage != zcss_init, stage_wrong);
ZSTD_clearAllDicts(cctx);
cctx->prefixDict.dict = prefix;
cctx->prefixDict.dictSize = prefixSize;
cctx->prefixDict.dictContentType = dictContentType;
if (prefix != NULL && prefixSize > 0) {
cctx->prefixDict.dict = prefix;
cctx->prefixDict.dictSize = prefixSize;
cctx->prefixDict.dictContentType = dictContentType;
}
return 0;
}