diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index d9f49b9d2ec..24176f0b254 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1029,6 +1029,8 @@ main(argc, argv) tv = &timeout; } else tv = NULL; + if (s >= FD_SETSIZE) + errx(1, "descriptor too big"); memset(fdmaskp, 0, fdmasks); FD_SET(s, fdmaskp); cc = select(s + 1, fdmaskp, NULL, NULL, tv);