]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix#500 use of non-initialised values on socket bind failures.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 16 May 2013 08:14:03 +0000 (08:14 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 16 May 2013 08:14:03 +0000 (08:14 +0000)
git-svn-id: file:///svn/unbound/trunk@2901 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/listen_dnsport.c

index 9e8aff2fbe3d6e102230417866b90a5b9685bffa..2dfbdd386ea816f3a1d6785a113dc92fa5490186 100644 (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
index 647cbe07ebd9841b668de96445fe64ea0b2a9b9c..368faaea42119c6dc9c5f46a428dc2085503f889 100644 (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);