aboutsummaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2021-02-14 21:07:21 +0000
committerEd Maste <emaste@FreeBSD.org>2021-02-14 21:07:21 +0000
commitdb903103f46785ea0bba0f228691e1f8fb3a643d (patch)
tree74026f96189cd1c487ea2c8e038b921e3861e1b1 /hostfile.c
parent82e5fdc50050d6dccf1f547818312aebd3b6626e (diff)
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hostfile.c b/hostfile.c
index 4a0349a60a39..a4a355972522 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.77 2020/01/25 00:21:08 djm Exp $ */
+/* $OpenBSD: hostfile.c,v 1.79 2020/03/06 18:25:12 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -298,8 +298,7 @@ free_hostkeys(struct hostkeys *hostkeys)
explicit_bzero(hostkeys->entries + i, sizeof(*hostkeys->entries));
}
free(hostkeys->entries);
- explicit_bzero(hostkeys, sizeof(*hostkeys));
- free(hostkeys);
+ freezero(hostkeys, sizeof(*hostkeys));
}
static int
@@ -313,7 +312,7 @@ check_key_not_revoked(struct hostkeys *hostkeys, struct sshkey *k)
continue;
if (sshkey_equal_public(k, hostkeys->entries[i].key))
return -1;
- if (is_cert &&
+ if (is_cert && k != NULL &&
sshkey_equal_public(k->cert->signature_key,
hostkeys->entries[i].key))
return -1;