From c7172c183f03e8460fd1e2f9b8b78ba677bb6fc1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 28 Oct 2019 14:03:03 +0100 Subject: [PATCH] SSH-01-006: Add missing NULL check in ssh_gssapi_build_mic() Fixes T193 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- src/gssapi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gssapi.c b/src/gssapi.c index 7260f5ec..7f78c04d 100644 --- a/src/gssapi.c +++ b/src/gssapi.c @@ -444,13 +444,17 @@ static ssh_buffer ssh_gssapi_build_mic(ssh_session session) ssh_buffer mic_buffer = NULL; int rc; + crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_BOTH); + if (crypto == NULL) { + return NULL; + } + mic_buffer = ssh_buffer_new(); if (mic_buffer == NULL) { ssh_set_error_oom(session); return NULL; } - crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_BOTH); rc = ssh_buffer_pack(mic_buffer, "dPbsss", crypto->digest_len,