summaryrefslogtreecommitdiff
path: root/source3/libsmb/nmblib.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/nmblib.c')
-rw-r--r--source3/libsmb/nmblib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 1206d9ddb3d..8230c5ac0fd 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -1089,6 +1089,11 @@ struct packet_struct *receive_packet(int fd,enum packet_type type,int t)
struct timeval timeout;
int ret;
+ if (fd < 0 || fd >= FD_SETSIZE) {
+ errno = EBADF;
+ return NULL;
+ }
+
FD_ZERO(&fds);
FD_SET(fd,&fds);
timeout.tv_sec = t/1000;