diff options
author | 2003-04-24 16:20:04 +0000 | |
---|---|---|
committer | 2003-04-24 16:20:04 +0000 | |
commit | d94ecb9870da9a1ae013e863861783cdc5a64f23 (patch) | |
tree | d45abda596251f32b78614e38c4ea5031d4686bd | |
parent | fix typo; Patrick Latifi (diff) | |
download | wireguard-openbsd-d94ecb9870da9a1ae013e863861783cdc5a64f23.tar.xz wireguard-openbsd-d94ecb9870da9a1ae013e863861783cdc5a64f23.zip |
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.c | 6 |
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; } |