- Fix#500 use of non-initialised values on socket bind failures.

git-svn-id: file:///svn/unbound/trunk@2901 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2013-05-16 08:14:03 +00:00
parent 416df19f6d
commit bee14bb0e2
2 changed files with 7 additions and 1 deletions

View file

@ -1,6 +1,7 @@
16 May 2013: Wouter
- Fix use-after-free in out-of-memory handling code (thanks Jake
- Fix#499 use-after-free in out-of-memory handling code (thanks Jake
Montgomery).
- Fix#500 use on non-initialised values on socket bind failures.
15 May 2013: Wouter
- Fix round-robin doesn't work with some Windows clients (from Ilya

View file

@ -328,6 +328,8 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
# else
closesocket(s);
# endif
*noproto = 0;
*inuse = 0;
return -1;
}
# elif defined(IP_DONTFRAG)
@ -341,12 +343,15 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr,
# else
closesocket(s);
# endif
*noproto = 0;
*inuse = 0;
return -1;
}
# endif /* IPv4 MTU */
}
if(bind(s, (struct sockaddr*)addr, addrlen) != 0) {
*noproto = 0;
*inuse = 0;
#ifndef USE_WINSOCK
#ifdef EADDRINUSE
*inuse = (errno == EADDRINUSE);