(loop, proto): check that the fd's aren't too large to select on
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9185 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -62,6 +62,9 @@ loop (int s, int errsock) | ||||
|     fd_set real_readset; | ||||
|     int count = 1; | ||||
|  | ||||
|     if (s >= FD_SETSIZE || errsock >= FD_SETSIZE) | ||||
| 	errx (1, "fd too large"); | ||||
|      | ||||
|     FD_ZERO(&real_readset); | ||||
|     FD_SET(s, &real_readset); | ||||
|     if (errsock != -1) { | ||||
| @@ -445,6 +448,9 @@ proto (int s, int errsock, | ||||
| 	for (;;) { | ||||
| 	    fd_set fdset; | ||||
|  | ||||
| 	    if (errsock >= FD_SETSIZE || s >= FD_SETSIZE) | ||||
| 		errx (1, "fd too large"); | ||||
|  | ||||
| 	    FD_ZERO(&fdset); | ||||
| 	    FD_SET(errsock, &fdset); | ||||
| 	    FD_SET(s, &fdset); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund