aboutsummaryrefslogtreecommitdiff
path: root/src/gzip.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-05-28 08:41:48 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-05-28 09:18:52 +0200
commita7e17a34ad7b29e06120e9abfeb82149c742fcf1 (patch)
tree48b227cdf5864d5bf279d5fbd68522da14b43448 /src/gzip.c
parentd9f9bee13fce6cc40171e400622a12efbcaccf21 (diff)
downloadlibssh-a7e17a34ad7b29e06120e9abfeb82149c742fcf1.tar.gz
libssh-a7e17a34ad7b29e06120e9abfeb82149c742fcf1.tar.xz
libssh-a7e17a34ad7b29e06120e9abfeb82149c742fcf1.zip
gzip: Add missing NULL check
CID 1398980 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/gzip.c')
-rw-r--r--src/gzip.c3
1 files changed, 3 insertions, 0 deletions
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);