summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
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 4a0349a60..a4a355972 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hostfile.c,v 1.77 2020/01/25 00:21:08 djm Exp $ */ 1/* $OpenBSD: hostfile.c,v 1.79 2020/03/06 18:25:12 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -298,8 +298,7 @@ free_hostkeys(struct hostkeys *hostkeys)
298 explicit_bzero(hostkeys->entries + i, sizeof(*hostkeys->entries)); 298 explicit_bzero(hostkeys->entries + i, sizeof(*hostkeys->entries));
299 } 299 }
300 free(hostkeys->entries); 300 free(hostkeys->entries);
301 explicit_bzero(hostkeys, sizeof(*hostkeys)); 301 freezero(hostkeys, sizeof(*hostkeys));
302 free(hostkeys);
303} 302}
304 303
305static int 304static int
@@ -313,7 +312,7 @@ check_key_not_revoked(struct hostkeys *hostkeys, struct sshkey *k)
313 continue; 312 continue;
314 if (sshkey_equal_public(k, hostkeys->entries[i].key)) 313 if (sshkey_equal_public(k, hostkeys->entries[i].key))
315 return -1; 314 return -1;
316 if (is_cert && 315 if (is_cert && k != NULL &&
317 sshkey_equal_public(k->cert->signature_key, 316 sshkey_equal_public(k->cert->signature_key,
318 hostkeys->entries[i].key)) 317 hostkeys->entries[i].key))
319 return -1; 318 return -1;