diff options
author | jkh <jkh@FreeBSD.org> | 1996-01-16 02:09:23 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-01-16 02:09:23 +0000 |
commit | 495cba1af366721567e7468f48c44c22f494a7cc (patch) | |
tree | 6eb4210e64e58f7d0273f1458b24f4169c5aa98a /usr.bin/host | |
parent | 535a8056f5f9b8b1d4b17c743b91bae47151a148 (diff) | |
download | FreeBSD-src-495cba1af366721567e7468f48c44c22f494a7cc.zip FreeBSD-src-495cba1af366721567e7468f48c44c22f494a7cc.tar.gz |
Guard against argument starvation.
Noted by: aagero@aage.aage.priv.no
Diffstat (limited to 'usr.bin/host')
-rw-r--r-- | usr.bin/host/host.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/host/host.c b/usr.bin/host/host.c index f417a3c..85fbd1c 100644 --- a/usr.bin/host/host.c +++ b/usr.bin/host/host.c @@ -67,7 +67,7 @@ char copyright[] = */ #ifndef lint -static char rcsid[] = "$Id: host.c,v 1.5 1995/10/23 16:07:56 peter Exp $"; +static char rcsid[] = "$Id: host.c,v 1.6 1996/01/07 06:21:56 peter Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -217,8 +217,8 @@ main(c, v) _res.nscount = 1; _res.retry = 2; } - if (strcmp (v[1], ".") == 0 || - !inet_aton(v[1], (struct in_addr *)&addr)) + if (c > 1 && (strcmp (v[1], ".") == 0 || + !inet_aton(v[1], (struct in_addr *)&addr))) addr = -1; hp = NULL; h_errno = TRY_AGAIN; |