summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2002-09-09 16:21:10 +0000
committernectar <nectar@FreeBSD.org>2002-09-09 16:21:10 +0000
commit38c1241397d4842137e208a9bb1e3c901e533dd6 (patch)
tree2e0c3ac4563e038e17b26e08812c73f894d24140 /usr.sbin
parent89a48b22ec8c2358742b93336b8090b7185ff9ee (diff)
downloadFreeBSD-src-38c1241397d4842137e208a9bb1e3c901e533dd6.zip
FreeBSD-src-38c1241397d4842137e208a9bb1e3c901e533dd6.tar.gz
Check for FD_SET overrun.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/traceroute6/traceroute6.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c
index f5f3fbe..37f639b 100644
--- a/usr.sbin/traceroute6/traceroute6.c
+++ b/usr.sbin/traceroute6/traceroute6.c
@@ -934,6 +934,8 @@ wait_for_reply(sock, mhdr)
fdsn = howmany(sock + 1, NFDBITS) * sizeof(fd_mask);
if ((fdsp = (fd_set *)malloc(fdsn)) == NULL)
err(1, "malloc");
+ if (sock >= FD_SETSIZE)
+ errx(1, "descriptor too big");
memset(fdsp, 0, fdsn);
FD_SET(sock, fdsp);
wait.tv_sec = waittime; wait.tv_usec = 0;
OpenPOWER on IntegriCloud