aboutsummaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authorAlice Atlas <alice@lant.is>2017-12-04 16:07:31 -0500
committerAlice Atlas <alice@lant.is>2017-12-04 16:07:31 -0500
commit42a31aee50ec325fbba93ce405ab83c25fc710e1 (patch)
treeba5787f80f98974852c419dd5c313df66a97c3ed /programs
parent6c94c94d4673bd2c0bc3ff80ca17cff8c19a465a (diff)
downloadlz4-42a31aee50ec325fbba93ce405ab83c25fc710e1.tar.gz
Fix bug which could sometimes result in the lz4 cli chmodding /dev/null if running as root
Diffstat (limited to 'programs')
-rw-r--r--programs/lz4io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 57434f79..9bf4e939 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -616,7 +616,7 @@ static int LZ4IO_compressFilename_extRess(cRess_t ress, const char* srcFileName,
/* Copy owner, file permissions and modification time */
{ stat_t statbuf;
- if (strcmp (srcFileName, stdinmark) && strcmp (dstFileName, stdoutmark) && UTIL_getFileStat(srcFileName, &statbuf))
+ if (strcmp (srcFileName, stdinmark) && strcmp (dstFileName, stdoutmark) && strcmp (dstFileName, nulmark) && UTIL_getFileStat(srcFileName, &statbuf))
UTIL_setFileStat(dstFileName, &statbuf);
}