]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Return error code when initializing NULL cctxParams
authorStella Lau <laus@fb.com>
Mon, 21 Aug 2017 18:44:58 +0000 (11:44 -0700)
committerStella Lau <laus@fb.com>
Mon, 21 Aug 2017 18:52:26 +0000 (11:52 -0700)
lib/compress/zstd_compress.c

index 530611dd5a8aeb72c0eb7f4f5b5dcaa65a6a3d54..69e9778901032c207e067db93150790cb3d15c23 100644 (file)
@@ -268,6 +268,7 @@ size_t ZSTD_resetCCtxParams(ZSTD_CCtx_params* params)
 
 size_t ZSTD_initCCtxParams(ZSTD_CCtx_params* cctxParams, ZSTD_parameters params)
 {
+    if (!cctxParams) { return ERROR(GENERIC); }
     memset(cctxParams, 0, sizeof(ZSTD_CCtx_params));
     cctxParams->cParams = params.cParams;
     cctxParams->fParams = params.fParams;