From: shakeelrao Date: Sun, 24 Mar 2019 07:23:50 +0000 (-0700) Subject: Add NULL check for dict X-Git-Tag: v1.4.0^2~22^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5333e41ab38668732b6403cf5a170e6c92d5b45c;p=thirdparty%2Fzstd.git Add NULL check for dict --- diff --git a/programs/fileio.c b/programs/fileio.c index 7da7baaff..cbd7b92bc 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1298,8 +1298,8 @@ FIO_compressFilename_srcFile(FIO_prefs_t* const prefs, return 1; } - /* ensure src is not the same as dict */ - if (UTIL_isSameFile(srcFileName, ress.dictFileName)) { + /* ensure src is not the same as dict (if present) */ + if (ress.dictFileName != NULL && UTIL_isSameFile(srcFileName, ress.dictFileName)) { DISPLAYLEVEL(1, "zstd: cannot use %s as an input file and dictionary \n", srcFileName); return 1; }