diff options
| author | Wolfram Schneider <wosch@FreeBSD.org> | 1997-12-27 03:38:39 +0000 |
|---|---|---|
| committer | Wolfram Schneider <wosch@FreeBSD.org> | 1997-12-27 03:38:39 +0000 |
| commit | 604310660142ef1d8cbeb91164f8636f598d4e2b (patch) | |
| tree | 5e64af5002e5d39724e83993f7c9bac49b2c4494 /gnu | |
| parent | 388610239fc3a322b7df358f7f57a8c120aca77f (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/gzip/gzip.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/usr.bin/gzip/gzip.c b/gnu/usr.bin/gzip/gzip.c index 87ab36a2774f..7a666baba17e 100644 --- a/gnu/usr.bin/gzip/gzip.c +++ b/gnu/usr.bin/gzip/gzip.c @@ -45,7 +45,7 @@ static char *license_msg[] = { */ #ifdef RCSID -static char rcsid[] = "$Id: gzip.c,v 1.6 1997/02/22 15:45:57 peter Exp $"; +static char rcsid[] = "$Id: gzip.c,v 1.7 1997/03/15 22:43:58 guido Exp $"; #endif #include <ctype.h> @@ -1006,6 +1006,13 @@ local int get_istat(iname, sbuf) char *dot; /* pointer to ifname extension, or NULL */ #endif + if (strlen(iname) >= sizeof(ifname) - 3) { + errno = ENAMETOOLONG; + perror(iname); + exit_code = ERROR; + return ERROR; + } + strcpy(ifname, iname); /* If input file exists, return OK. */ |
