upstream: fix possible null-deref in check_key_not_revoked; ok

djm

OpenBSD-Commit-ID: 80855e9d7af42bb6fcc16c074ba69876bfe5e3bf
This commit is contained in:
markus@openbsd.org 2020-03-06 18:25:12 +00:00 committed by Damien Miller
parent bc30b44684
commit fbff605e63
1 changed files with 2 additions and 2 deletions

View File

@ -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> * Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -312,7 +312,7 @@ check_key_not_revoked(struct hostkeys *hostkeys, struct sshkey *k)
continue; continue;
if (sshkey_equal_public(k, hostkeys->entries[i].key)) if (sshkey_equal_public(k, hostkeys->entries[i].key))
return -1; return -1;
if (is_cert && if (is_cert && k != NULL &&
sshkey_equal_public(k->cert->signature_key, sshkey_equal_public(k->cert->signature_key,
hostkeys->entries[i].key)) hostkeys->entries[i].key))
return -1; return -1;