From 56d571ab8171a1282da0cbd4f9d5b7b9724d7aa5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 28 Oct 2019 14:22:52 +0100 Subject: [PATCH] SSH-01-006: Add missing NULL check in ssh_pki_do_sign_agent() Fixes T193 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- src/pki.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pki.c b/src/pki.c index 3bd7f272..44ea9ff7 100644 --- a/src/pki.c +++ b/src/pki.c @@ -2384,6 +2384,9 @@ ssh_string ssh_pki_do_sign_agent(ssh_session session, int rc; crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_BOTH); + if (crypto == NULL) { + return NULL; + } /* prepend session identifier */ session_id = ssh_string_new(crypto->digest_len);