Check for FD_SET overrun.

This commit is contained in:
Jacques Vidrine 2002-09-09 16:21:10 +00:00
parent 75bed0534a
commit acc005185b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103132

View File

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