summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2015-08-19 23:17:52 +0000
committerDamien Miller <djm@cvs.openbsd.org>2015-08-19 23:17:52 +0000
commit1ed52a11356b4793036931f18e48556ea50405cf (patch)
treeab944d949e53e2a0f10760c08be98b8a33f43825 /usr.bin
parent4ef918b6cf0ee8b53bbb1680c97505eb20291573 (diff)
fixed unlink([uninitialised memory]) reported by Mateusz Kocielski;
ok markus@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/ssh-keygen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 1c3515e7c3a..dc84393f68e 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -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
@@ -1186,7 +1186,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)