[openssh-commits] [openssh] 21/22: upstream: fix use-after-free in do_download_sk; ok djm

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 13 13:18:58 AEDT 2020


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

djm pushed a commit to branch master
in repository openssh.

commit e32ef97a56ae03febfe307688858badae3a70e5a
Author: markus at openbsd.org <markus at openbsd.org>
Date:   Fri Mar 6 18:29:14 2020 +0000

    upstream: fix use-after-free in do_download_sk; ok djm
    
    OpenBSD-Commit-ID: 96b49623d297797d4fc069f1f09e13c8811f8863
---
 ssh-keygen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ssh-keygen.c b/ssh-keygen.c
index 3c6c9a18..aa4ec065 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.401 2020/03/06 18:15:04 markus Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.402 2020/03/06 18:29:14 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1994 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -3025,9 +3025,9 @@ do_download_sk(const char *skprovider, const char *device)
 		free(path);
 		if ((r = sshkey_save_public(keys[i], pubpath,
 		    keys[i]->sk_application)) != 0) {
-			free(pubpath);
 			error("Saving public key \"%s\" failed: %s",
 			    pubpath, ssh_err(r));
+			free(pubpath);
 			break;
 		}
 		free(pubpath);

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


More information about the openssh-commits mailing list