summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2003-04-24 16:20:05 +0000
committerChad Loder <cloder@cvs.openbsd.org>2003-04-24 16:20:05 +0000
commit0fe23fcd7c5f09b4e8a341831cb14f5fbc7bd4a1 (patch)
tree3f7f9614fbf01b8980a04823d838d53a57ea2c8a
parentbf5ce4b23e34e9e5ee3dc8f83d0eb3ea031b1b43 (diff)
Validation of command line argument for packet data length was comparing
to the wrong thing, which resulted in a confusing error message later on. Do validation on the user supplied parameter. ok millert
-rw-r--r--usr.sbin/traceroute/traceroute.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c
index aa7141ace99..6750c14d2f2 100644
--- a/usr.sbin/traceroute/traceroute.c
+++ b/usr.sbin/traceroute/traceroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traceroute.c,v 1.53 2002/11/18 04:45:11 itojun Exp $ */
+/* $OpenBSD: traceroute.c,v 1.54 2003/04/24 16:20:04 cloder Exp $ */
/* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)traceroute.c 8.1 (Berkeley) 6/6/93";*/
#else
-static char rcsid[] = "$OpenBSD: traceroute.c,v 1.53 2002/11/18 04:45:11 itojun Exp $";
+static char rcsid[] = "$OpenBSD: traceroute.c,v 1.54 2003/04/24 16:20:04 cloder Exp $";
#endif
#endif /* not lint */
@@ -480,7 +480,7 @@ main(int argc, char *argv[])
errno = 0;
ep = NULL;
l = strtoul(*argv, &ep, 10);
- if (errno || !*argv || *ep || datalen > INT_MAX)
+ if (errno || !*argv || *ep || l > INT_MAX)
errx(1, "datalen out of range");
datalen = (int)l;
}