From 55230315d1d5b350887d0c978ae5698979009fae Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Tue, 28 Jun 2016 16:38:26 +0000 Subject: [PATCH] Don't copy NULL (Igor Gnatenko) --- src/compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compress.c b/src/compress.c index 1988fe78..cbcad5e6 100644 --- a/src/compress.c +++ b/src/compress.c @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.97 2016/05/13 23:02:28 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.98 2016/06/28 16:38:26 christos Exp $") #endif #include "magic.h" @@ -517,7 +517,7 @@ uncompresszlib(const unsigned char *old, unsigned char **newch, return OKDATA; err: - strlcpy((char *)*newch, z.msg, bytes_max); + strlcpy((char *)*newch, z.msg ? z.msg : zError(rc), bytes_max); *n = strlen((char *)*newch); return ERRDATA; } -- 2.40.0