From: Paul Eggert Date: Tue, 2 Aug 2016 07:31:04 +0000 (-0400) Subject: Fix use-after-close in connect_network_socket X-Git-Tag: emacs-26.0.90~1831 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=53917616b0aca43b9ca85531d4dcb426885bdb73;p=emacs.git Fix use-after-close in connect_network_socket * 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 --- diff --git a/src/process.c b/src/process.c index bc2ac451c9d..5e48e4348fe 100644 --- a/src/process.c +++ b/src/process.c @@ -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