diff options
author | teor <teor2345@gmail.com> | 2017-06-16 09:38:18 +1000 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2017-06-16 09:38:18 +1000 |
commit | 8e1b37a4aa9d6277637f82100ac1823a6a193c63 (patch) | |
tree | 3cda8fa5bdb679d813077ea3e541f9c8fefb7fc1 /src/common | |
parent | 80ad374b8457e4c92f88f8a89376a8ca87231c9c (diff) | |
download | tor-8e1b37a4aa9d6277637f82100ac1823a6a193c63.tar.gz tor-8e1b37a4aa9d6277637f82100ac1823a6a193c63.zip |
Check if tor_compress_new() returns NULL in tor_compress_impl()
Partial fix to 22626.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compress.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/compress.c b/src/common/compress.c index 6513029f9c..92b64d1e91 100644 --- a/src/common/compress.c +++ b/src/common/compress.c @@ -128,6 +128,11 @@ tor_compress_impl(int compress, // inputs. tor_compress_free(stream); stream = tor_compress_new(compress, method, compression_level); + if (stream == NULL) { + log_warn(LD_GENERAL, "NULL stream while %scompressing", + compress?"":"de"); + goto err; + } } break; case TOR_COMPRESS_OK: |