aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-01-16 02:09:23 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-01-16 02:09:23 +0000
commit1ce11aadccf6206d34c990ea2b113e41bcbf0d23 (patch)
tree6eb4210e64e58f7d0273f1458b24f4169c5aa98a /usr.bin
parent293cc16decd666716f8535163389c3af5116e11f (diff)
downloadsrc-1ce11aadccf6206d34c990ea2b113e41bcbf0d23.tar.gz
src-1ce11aadccf6206d34c990ea2b113e41bcbf0d23.zip
Guard against argument starvation.
Noted by: aagero@aage.aage.priv.no
Notes
Notes: svn path=/head/; revision=13450
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/host/host.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/host/host.c b/usr.bin/host/host.c
index f417a3c79e96..85fbd1ca2e81 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;