diff --git a/common-src/ambind.c b/common-src/ambind.c index 6a4c9d887..d9fee46b1 100644 --- a/common-src/ambind.c +++ b/common-src/ambind.c @@ -58,6 +58,11 @@ main( } sockfd = atoi(argv[1]); + if (sockfd < 0 || sockfd >= FD_SETSIZE) { + fprintf(stderr, "ambind: incorrect file descriptor provided: %d\n", sockfd); + return -1; + } + do { struct timeval timeout = { 5, 0 }; fd_set readSet;