aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-05-28 08:33:22 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-05-28 09:18:51 +0200
commit18a89c6ec2f5eaace644ff9cd5c663203b10d970 (patch)
tree1969c5543ec7cf397d3e105d2488728837d9a02d /src/pki.c
parentcb502a4a6d3f86b656bb5ebc0ae08e5e2f3fc48e (diff)
downloadlibssh-18a89c6ec2f5eaace644ff9cd5c663203b10d970.tar.gz
libssh-18a89c6ec2f5eaace644ff9cd5c663203b10d970.tar.xz
libssh-18a89c6ec2f5eaace644ff9cd5c663203b10d970.zip
pki: Avoid a null pointer derefrence
CID 1401434 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki.c')
-rw-r--r--src/pki.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pki.c b/src/pki.c
index 888f21ad..0fbfc115 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -2152,13 +2152,14 @@ int ssh_pki_signature_verify(ssh_session session,
size_t input_len)
{
int rc;
- enum ssh_keytypes_e key_type = ssh_key_type_plain(key->type);
+ enum ssh_keytypes_e key_type;
if (session == NULL || sig == NULL || key == NULL || input == NULL) {
SSH_LOG(SSH_LOG_TRACE, "Bad parameter provided to "
"ssh_pki_signature_verify()");
return SSH_ERROR;
}
+ key_type = ssh_key_type_plain(key->type);
SSH_LOG(SSH_LOG_FUNCTIONS,
"Going to verify a %s type signature",