From a7e17a34ad7b29e06120e9abfeb82149c742fcf1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 28 May 2019 08:41:48 +0200 Subject: [PATCH] gzip: Add missing NULL check CID 1398980 Signed-off-by: Andreas Schneider --- src/gzip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gzip.c b/src/gzip.c index 38f0de72..2de576f8 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -67,6 +67,9 @@ static ssh_buffer gzip_compress(ssh_session session, ssh_buffer source, int leve int status; crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_OUT); + if (crypto == NULL) { + return NULL; + } zout = crypto->compress_out_ctx; if (zout == NULL) { zout = crypto->compress_out_ctx = initcompress(session, level);