Check for FD_SET overrun.

This commit is contained in:
Jacques Vidrine 2002-09-09 16:06:41 +00:00
parent ef9d72e14c
commit 012b8a4111

View file

@ -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);