From d24e353e38ebce26563975dfdc0791e95dacbaf7 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sun, 18 Sep 2011 20:29:39 +0200 Subject: [PATCH] pki: null ptr check --- src/pki.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pki.c b/src/pki.c index dcb97bb2..d0e52c44 100644 --- a/src/pki.c +++ b/src/pki.c @@ -1233,7 +1233,11 @@ ssh_string ssh_srv_pki_do_sign_sessionid(ssh_session session, if (ctx == NULL) { return NULL; } - sha1_update(ctx, crypto->session_id, SHA_DIGEST_LEN); + if (crypto->session_id == NULL){ + ssh_set_error(session,SSH_FATAL,"Missing session_id"); + return NULL; + } + sha1_update(ctx, crypto->session_id, crypto->digest_len); sha1_final(hash, ctx); #ifdef DEBUG_CRYPTO