(res_send): Check for overflow in descriptor set.
authordrepper <drepper>
Thu, 29 May 1997 12:01:58 +0000 (12:01 +0000)
committerdrepper <drepper>
Thu, 29 May 1997 12:01:58 +0000 (12:01 +0000)
resolv/res_send.c

index 60d8ef2..cde6a84 100644 (file)
@@ -601,6 +601,11 @@ read_len:
                        if ((long) timeout.tv_sec <= 0)
                                timeout.tv_sec = 1;
                        timeout.tv_usec = 0;
+                       if (s+1 > FD_SETSIZE) {
+                               Perror(stderr, "s+1 > FD_SETSIZE", EMFILE);
+                               res_close();
+                               goto next_ns;
+                       }
     wait:
                        FD_ZERO(&dsmask);
                        FD_SET(s, &dsmask);