aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-10-28 14:22:52 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-12-09 16:08:03 +0100
commit56d571ab8171a1282da0cbd4f9d5b7b9724d7aa5 (patch)
tree6827d497c6ead2239525310a7ec76de2aae0c58f /src/pki.c
parent69daa602b80da009413ca9e91703d6922130013d (diff)
downloadlibssh-56d571ab8171a1282da0cbd4f9d5b7b9724d7aa5.tar.gz
libssh-56d571ab8171a1282da0cbd4f9d5b7b9724d7aa5.tar.xz
libssh-56d571ab8171a1282da0cbd4f9d5b7b9724d7aa5.zip
SSH-01-006: Add missing NULL check in ssh_pki_do_sign_agent()
Fixes T193 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/pki.c')
-rw-r--r--src/pki.c3
1 files changed, 3 insertions, 0 deletions
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);