From nobody Tue Oct 04 21:17:25 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MhrBY6Gc1z4dkdF; Tue, 4 Oct 2022 21:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MhrBY5kMPz3HNC; Tue, 4 Oct 2022 21:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664918245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5evio5wS7rEOC9WjDvo3fqzFa/CUE46v8VjUNihahlk=; b=jMT/YHhbeqliB8g5EkRB2MEOso9ITfaKFfxGCTk1Bw7jvuJ41qmgL9CyEiOnbv8Q4ejIip 7H4hIvZGthp+ptLqGaVcQsUQgjQ3o/ljb5m9nouJeGcVxEArs+5RK6Oq+nPRXT8RgnzK0d U8IZ4X14pALYVMqUGtDc5bkSKUaJLUKprlRLpdBxm2Mgd/lS9iQW6WwGiCOK12v6V8yz++ qNP/3olphOpBkZRvv4q0hvElD+Lp48cDjkfP2IFcARAXLQR3tJmM9UF+cdVPhkDkN6z0ak I+7MMtcndAlVO9gXnXe/lDWhf5uM1KyycmUujhSpUZR9NqJbqxI/YzS+bU2tiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MhrBY4mfyzhLp; Tue, 4 Oct 2022 21:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 294LHPZc012405; Tue, 4 Oct 2022 21:17:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 294LHPXH012404; Tue, 4 Oct 2022 21:17:25 GMT (envelope-from git) Date: Tue, 4 Oct 2022 21:17:25 GMT Message-Id: <202210042117.294LHPXH012404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 963c7b084b8b - main - ssh-keysign: fix double free in error path List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 963c7b084b8bf2397deced4f568b976a42611910 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664918245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5evio5wS7rEOC9WjDvo3fqzFa/CUE46v8VjUNihahlk=; b=iOxlDmH6fK9hWTnf5vucvwbq5ZBdxvCLUn29d6ZBwnOv2Nc1Sywx9YCGwYEvO7EWl1oj3W BOjRB7gQyQ2KESe5o/fVcn9+kh5nD/kqfHlWcAScFmDSOqPBNW+kQVNxWjRlF9iZ5Py6ik DR+87bGtEgulqgm1M3Vo59pnSbzlKiOqQnOO9vEDvYaNvs60boOk/DcAxC8XBwLCG9Ps1G X5yuyrQbcWpHzCccjQLgvHi06T4tyF+kKa5b1TNfSTMBlWQedWXcTPuNYdJ7zDvceGrRFP Fxsjz/RBZPyg6lTSn7GtwNigjEsvlzZK6mo7thgM1eXFGAMt+jdV7UKxbRbbCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664918245; a=rsa-sha256; cv=none; b=S91Tu9thMiAVjHEwtGewCLcX7OCcrrI6sgoxusrBRuBMzrP7QxiRi01NvAJIjR5Gmyivig qIi/3cV22vWs2HfmGePwDTGJldcFU7SZqazhMdg6rvZ8gQ/feB8siwc8trkPJzZZMwIX9V jirBo4bciraLed1bzJXyzFN73bA+0ysgO3Zawd03w8x40Y+tS9NyL3jKi20wK0l5lP04yg GRftO8JI0ObB9vCB64kmeoPaqZdU1dR34SZPk4SWmmuJz3QjY7uxfU1RSefPoJARco41u8 cQ0B9IqFYsgo+rdlHuwHIEar3k1VY3bl4Y+JcVwfU+8iG4FUtDQErgVaZ3/u7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=963c7b084b8bf2397deced4f568b976a42611910 commit 963c7b084b8bf2397deced4f568b976a42611910 Author: Ed Maste AuthorDate: 2022-10-04 20:34:15 +0000 Commit: Ed Maste CommitDate: 2022-10-04 20:34:37 +0000 ssh-keysign: fix double free in error path From OpenSSH-portable commit 141535b904b6, OpenBSD commit 3d21aa127b1f. MFC after: 3 days --- crypto/openssh/ssh-keysign.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/ssh-keysign.c b/crypto/openssh/ssh-keysign.c index c52321e220e7..b989f5e941ad 100644 --- a/crypto/openssh/ssh-keysign.c +++ b/crypto/openssh/ssh-keysign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keysign.c,v 1.70 2022/01/06 22:00:18 djm Exp $ */ +/* $OpenBSD: ssh-keysign.c,v 1.71 2022/08/01 11:09:26 djm Exp $ */ /* * Copyright (c) 2002 Markus Friedl. All rights reserved. * @@ -155,9 +155,7 @@ valid_request(struct passwd *pw, char *host, struct sshkey **ret, char **pkalgp, debug3_f("fail %d", fail); - if (fail) - sshkey_free(key); - else { + if (!fail) { if (ret != NULL) { *ret = key; key = NULL;