summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2020-03-06 18:25:12 +0000
committermarkus <markus@openbsd.org>2020-03-06 18:25:12 +0000
commit15d5fa5b48f2d74cf3227a7058f85adda4e5414a (patch)
tree1597e644f35b757a0f00730ee5858722b4acc745
parentssh_fetch_identitylist() returns the return value from (diff)
downloadwireguard-openbsd-15d5fa5b48f2d74cf3227a7058f85adda4e5414a.tar.xz
wireguard-openbsd-15d5fa5b48f2d74cf3227a7058f85adda4e5414a.zip
fix possible null-deref in check_key_not_revoked; ok djm
-rw-r--r--usr.bin/ssh/hostfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/hostfile.c b/usr.bin/ssh/hostfile.c
index 1ec86f324aa..c661b88a785 100644
--- a/usr.bin/ssh/hostfile.c
+++ b/usr.bin/ssh/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.78 2020/02/26 13:40:09 jsg 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
@@ -310,7 +310,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;