Browse Source

Security fix from PuTTY 0.73 - vuln-win-exclusiveaddruse

Source commit: 53fdbfc23ddbb5f35e276e6281dc53cb03ffca97
Martin Prikryl 6 years ago
parent
commit
d16fb9effe
1 changed files with 5 additions and 2 deletions
  1. 5 2
      source/putty/windows/winnet.c

+ 5 - 2
source/putty/windows/winnet.c

@@ -1379,7 +1379,6 @@ Socket sk_newlistener(const char *srcaddr, int port, Plug plug,
     char *errstr;
     Actual_Socket ret;
     int retcode;
-    int on = 1;
 
     int address_family;
 
@@ -1436,7 +1435,11 @@ Socket sk_newlistener(const char *srcaddr, int port, Plug plug,
 
     ret->oobinline = 0;
 
-    p_setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof(on));
+    {
+        BOOL on = 1;
+        p_setsockopt(s, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
+                     (const char *)&on, sizeof(on));
+    }
 
 #ifndef NO_IPV6
 	if (address_family == AF_INET6) {