mirror of
https://github.com/facebook/zstd.git
synced 2025-12-15 00:04:04 -05:00
Fix a nullptr dereference in ZSTD_createCDict_advanced2()
If the relevant allocation returns NULL, ZSTD_createCDict_advanced_internal() will return NULL. But ZSTD_createCDict_advanced2() doesn't check for this and attempts to use the returned pointer anyway, which leads to a segfault.
This commit is contained in:
parent
86ead9f4a4
commit
9a3b17c4d6
@ -5525,7 +5525,7 @@ ZSTD_CDict* ZSTD_createCDict_advanced2(
|
||||
cctxParams.useRowMatchFinder, cctxParams.enableDedicatedDictSearch,
|
||||
customMem);
|
||||
|
||||
if (ZSTD_isError( ZSTD_initCDict_internal(cdict,
|
||||
if (!cdict || ZSTD_isError( ZSTD_initCDict_internal(cdict,
|
||||
dict, dictSize,
|
||||
dictLoadMethod, dictContentType,
|
||||
cctxParams) )) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user