diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-08-19 23:17:51 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-08-20 13:07:40 +1000 |
commit | c837643b93509a3ef538cb6624b678c5fe32ff79 (patch) | |
tree | dd2912619c35cc4e1bc6dc1f88e226fd63e1f4b8 | |
parent | 1f8d3d629cd553031021068eb9c646a5f1e50994 (diff) |
upstream commit
fixed unlink([uninitialised memory]) reported by Mateusz
Kocielski; ok markus@
Upstream-ID: 14a0c4e7d891f5a8dabc4b89d4f6b7c0d5a20109
-rw-r--r-- | ssh-keygen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c index ea5f1e49e..4e0a85554 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keygen.c,v 1.276 2015/07/03 03:49:45 djm Exp $ */ | 1 | /* $OpenBSD: ssh-keygen.c,v 1.277 2015/08/19 23:17:51 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1201,7 +1201,8 @@ do_known_hosts(struct passwd *pw, const char *name) | |||
1201 | exit(1); | 1201 | exit(1); |
1202 | } else if (delete_host && !ctx.found_key) { | 1202 | } else if (delete_host && !ctx.found_key) { |
1203 | logit("Host %s not found in %s", name, identity_file); | 1203 | logit("Host %s not found in %s", name, identity_file); |
1204 | unlink(tmp); | 1204 | if (inplace) |
1205 | unlink(tmp); | ||
1205 | } else if (inplace) { | 1206 | } else if (inplace) { |
1206 | /* Backup existing file */ | 1207 | /* Backup existing file */ |
1207 | if (unlink(old) == -1 && errno != ENOENT) | 1208 | if (unlink(old) == -1 && errno != ENOENT) |