git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix denial of service - memory corruption.
[samba.git]
/
source3
/
libaddns
/
dnssock.c
diff --git
a/source3/libaddns/dnssock.c
b/source3/libaddns/dnssock.c
index 7c8bd418e5765e5dc97ccd3e85a1c0dfb8aca1f9..bf11fea9313d4343fb599680a71a0ccb6909c202 100644
(file)
--- a/
source3/libaddns/dnssock.c
+++ b/
source3/libaddns/dnssock.c
@@
-219,6
+219,11
@@
static DNS_ERROR read_all(int fd, uint8 *data, size_t len)
ssize_t ret;
int fd_ready;
+ if (fd < 0 || fd >= FD_SETSIZE) {
+ /* read timeout */
+ return ERROR_DNS_SOCKET_ERROR;
+ }
+
FD_ZERO( &rfds );
FD_SET( fd, &rfds );