From 924dc5aed8cefafe478998fc6975bb1e1f1009e8 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 28 Oct 2019 14:18:20 +0100 Subject: [PATCH] SSH-01-006: Add missing NULL check in gzip_decompress() Fixes T193 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- src/gzip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gzip.c b/src/gzip.c index 2de576f8..76839931 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -162,6 +162,10 @@ static ssh_buffer gzip_decompress(ssh_session session, ssh_buffer source, size_t int status; crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_IN); + if (crypto == NULL) { + return NULL; + } + zin = crypto->compress_in_ctx; if (zin == NULL) { zin = crypto->compress_in_ctx = initdecompress(session);