]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix use-after-close in connect_network_socket
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 Aug 2016 07:31:04 +0000 (03:31 -0400)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 Aug 2016 07:31:26 +0000 (03:31 -0400)
* src/process.c (connect_network_socket):
Reverse sense of previous fix.  Problem reported by Ken Brown in:
http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00004.html

src/process.c

index bc2ac451c9df6e742d9beedac2873c254eb67e25..5e48e4348fe6f47a8a2654617a552155dff83702 100644 (file)
@@ -3185,7 +3185,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
              xerrno = errno;
              emacs_close (s);
              s = -1;
-             if (socket_to_use < 0)
+             if (0 <= socket_to_use)
                break;
              continue;
            }
@@ -3314,7 +3314,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
       specpdl_ptr = specpdl + count1;
       emacs_close (s);
       s = -1;
-      if (socket_to_use < 0)
+      if (0 <= socket_to_use)
        break;
 
 #ifdef WINDOWSNT