From e7152b4866f56f3bfec9de1f9c26ccf4b751d453 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 23 Oct 2016 13:54:52 -0700 Subject: [PATCH] gzip, gunzip: forbid empty suffix This matches the behavior of GNU gzip. --- programs/gzip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/programs/gzip.c b/programs/gzip.c index 3841de9..a579a9e 100644 --- a/programs/gzip.c +++ b/programs/gzip.c @@ -491,6 +491,10 @@ tmain(int argc, tchar *argv[]) break; case 'S': options.suffix = toptarg; + if (options.suffix[0] == T('\0')) { + msg("invalid suffix"); + return 1; + } break; case 'V': show_version();