[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/release-0.3.1] Check if tor_compress_new() returns NULL in tor_compress_impl()
commit 8e1b37a4aa9d6277637f82100ac1823a6a193c63
Author: teor <teor2345@xxxxxxxxx>
Date: Fri Jun 16 09:38:18 2017 +1000
Check if tor_compress_new() returns NULL in tor_compress_impl()
Partial fix to 22626.
---
src/common/compress.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/common/compress.c b/src/common/compress.c
index 6513029..92b64d1 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:
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits