]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Wed, 19 Aug 2015 23:17:51 +0000 (23:17 +0000)
committerDamien Miller <djm@mindrot.org>
Thu, 20 Aug 2015 03:07:40 +0000 (13:07 +1000)
fixed unlink([uninitialised memory]) reported by Mateusz
 Kocielski; ok markus@

Upstream-ID: 14a0c4e7d891f5a8dabc4b89d4f6b7c0d5a20109

ssh-keygen.c

index ea5f1e49e3d013e6840022a6e21b9c8b06c8ca9b..4e0a8555434c0deae9958fcdc2397aaec3fc960c 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.276 2015/07/03 03:49:45 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.277 2015/08/19 23:17:51 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1201,7 +1201,8 @@ do_known_hosts(struct passwd *pw, const char *name)
                exit(1);
        } else if (delete_host && !ctx.found_key) {
                logit("Host %s not found in %s", name, identity_file);
-               unlink(tmp);
+               if (inplace)
+                       unlink(tmp);
        } else if (inplace) {
                /* Backup existing file */
                if (unlink(old) == -1 && errno != ENOENT)