Check for FD_SET overrun.
This commit is contained in:
parent
4dfbdd7823
commit
ef9d72e14c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103129
@ -648,6 +648,10 @@ main(argc, argv)
|
|||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
|
|
||||||
check_status();
|
check_status();
|
||||||
|
if (s >= FD_SETSIZE) {
|
||||||
|
(void)fprintf(stderr, "descriptor too large");
|
||||||
|
exit(EX_OSERR);
|
||||||
|
}
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_SET(s, &rfds);
|
FD_SET(s, &rfds);
|
||||||
(void)gettimeofday(&now, NULL);
|
(void)gettimeofday(&now, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user