diff --git a/doc/Changelog b/doc/Changelog index 9e8aff2fb..2dfbdd386 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 647cbe07e..368faaea4 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -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);