diff options
author | des <des@FreeBSD.org> | 1999-02-15 08:11:44 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1999-02-15 08:11:44 +0000 |
commit | ec961933020ca4e5485a9283b73fe2d3f8cb312f (patch) | |
tree | 8ae70bbb20dd7ce45f8e89d2499b58075f7fa073 /contrib/traceroute | |
parent | 2bff3e0232a2b6e9115ecb9525f03bc9008d8a91 (diff) | |
download | FreeBSD-src-ec961933020ca4e5485a9283b73fe2d3f8cb312f.zip FreeBSD-src-ec961933020ca4e5485a9283b73fe2d3f8cb312f.tar.gz |
If the user provided a large enough argument to the -w option, the sum
would overflow and you'd end up doing select() with a negative timeout.
Diffstat (limited to 'contrib/traceroute')
-rw-r--r-- | contrib/traceroute/traceroute.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/traceroute/traceroute.c b/contrib/traceroute/traceroute.c index cca0cdd..78e7c82 100644 --- a/contrib/traceroute/traceroute.c +++ b/contrib/traceroute/traceroute.c @@ -24,7 +24,7 @@ static const char copyright[] = "@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] = - "@(#)$Header: /home/ncvs/src/contrib/traceroute/traceroute.c,v 1.5 1996/10/08 19:16:24 sef Exp $ (LBL)"; + "@(#)$Header: /home/ncvs/src/contrib/traceroute/traceroute.c,v 1.6 1998/06/06 23:33:28 jb Exp $ (LBL)"; #endif /* @@ -732,6 +732,8 @@ wait_for_reply(register int sock, register struct sockaddr_in *fromp, wait.tv_sec = tp->tv_sec + waittime; wait.tv_usec = tp->tv_usec; (void)gettimeofday(&now, &tz); + if (wait.tv_sec < now.tv_sec + 1) + wait.tv_sec = now.tv_sec + 1; tvsub(&wait, &now); if (select(sock + 1, &fds, (fd_set *)0, (fd_set *)0, &wait) > 0) |