diff options
author | obrien <obrien@FreeBSD.org> | 2004-05-03 10:29:23 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2004-05-03 10:29:23 +0000 |
commit | dcedc29dc55d117b1affb29750671810a1358532 (patch) | |
tree | 8b9ffcf18f6cb9ea2db188bcb42f010dea729dd2 /gnu | |
parent | ac0805e9e058b2d6a3d7a7bc42317d0715c5806c (diff) | |
download | FreeBSD-src-dcedc29dc55d117b1affb29750671810a1358532.zip FreeBSD-src-dcedc29dc55d117b1affb29750671810a1358532.tar.gz |
Tweak to rev 1.8 to match the offical http://www.gzip.org/gzip-1.2.4b.patch
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/gzip/gzip.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gnu/usr.bin/gzip/gzip.c b/gnu/usr.bin/gzip/gzip.c index b59b4d1..06b0a32 100644 --- a/gnu/usr.bin/gzip/gzip.c +++ b/gnu/usr.bin/gzip/gzip.c @@ -1011,14 +1011,15 @@ local int get_istat(iname, sbuf) #ifdef NO_MULTIPLE_DOTS char *dot; /* pointer to ifname extension, or NULL */ #endif + int max_suffix_len = (z_len > 3 ? z_len : 3); - if (strlen(iname) >= sizeof(ifname) - 3) { + /* Leave enough room in ifname or ofname for suffix: */ + if (strlen(iname) >= sizeof(ifname) - max_suffix_len) { errno = ENAMETOOLONG; perror(iname); exit_code = ERROR; return ERROR; } - strcpy(ifname, iname); /* If input file exists, return OK. */ |