[openssh-commits] [openssh] 01/01: upstream: fix a race condition in the SIGCHILD handler that could turn

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 1 14:56:45 AEDT 2019


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 4332b4fe49360679647a8705bc08f4e81323f6b4
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri Nov 1 03:54:33 2019 +0000

    upstream: fix a race condition in the SIGCHILD handler that could turn
    
    in to a kill(-1); bz3084, reported by Gao Rui, ok dtucker@
    
    OpenBSD-Commit-ID: ac2742e04a69d4c34223505b6a32f6d686e18896
---
 sftp.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/sftp.c b/sftp.c
index b66037f1..54538ff9 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.195 2019/10/02 00:42:30 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.196 2019/11/01 03:54:33 djm Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm at openbsd.org>
  *
@@ -220,9 +220,12 @@ static const struct CMD cmds[] = {
 static void
 killchild(int signo)
 {
-	if (sshpid > 1) {
-		kill(sshpid, SIGTERM);
-		waitpid(sshpid, NULL, 0);
+	pid_t pid;
+
+	pid = sshpid;
+	if (pid > 1) {
+		kill(pid, SIGTERM);
+		waitpid(pid, NULL, 0);
 	}
 
 	_exit(1);

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list