diff options
Diffstat (limited to 'source/lib/readline.c')
-rw-r--r-- | source/lib/readline.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/lib/readline.c b/source/lib/readline.c index 34867aad9e7..70a82f27ab7 100644 --- a/source/lib/readline.c +++ b/source/lib/readline.c @@ -91,6 +91,11 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void) timeout.tv_sec = 5; timeout.tv_usec = 0; + if (fd < 0 || fd >= FD_SETSIZE) { + errno = EBADF; + break; + } + FD_ZERO(&fds); FD_SET(fd,&fds); |