From 42a31aee50ec325fbba93ce405ab83c25fc710e1 Mon Sep 17 00:00:00 2001 From: Alice Atlas Date: Mon, 4 Dec 2017 16:07:31 -0500 Subject: [PATCH] Fix bug which could sometimes result in the lz4 cli chmodding /dev/null if running as root --- programs/lz4io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/lz4io.c b/programs/lz4io.c index 57434f7..9bf4e93 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); } -- 2.7.4