]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add NULL check for dict
authorshakeelrao <shakeelrao79@gmail.com>
Sun, 24 Mar 2019 07:23:50 +0000 (00:23 -0700)
committershakeelrao <shakeelrao79@gmail.com>
Sun, 24 Mar 2019 07:23:50 +0000 (00:23 -0700)
programs/fileio.c

index 7da7baaffc867fafad18ee93f43b5efc337b045b..cbd7b92bc615327b14b081fb889d91904636fe57 100644 (file)
@@ -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;
     }