1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

Check for sd > FD_SETSIZE before it is unrecoverable. Fixes #1857

This commit is contained in:
dmiller
2022-09-29 00:13:10 +00:00
parent de9f84d080
commit b5dd2956dd
3 changed files with 56 additions and 6 deletions

View File

@@ -244,11 +244,17 @@ public:
was in the list, false if you tried to clear an sd that wasn't
there in the first place. */
bool clearSD(int sd);
/* Try to get a socket that's good for select(). Return true if it worked;
* false if it didn't. */
bool sendOK();
int maxValidSD; /* The maximum socket descriptor in any of the fd_sets */
fd_set fds_read;
fd_set fds_write;
fd_set fds_except;
int numSDs; /* Number of socket descriptors being watched */
int getSocket();
private:
int nextSD;
int maxSocketsAllowed; /* No more than this many sockets may be created @once */
};