mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-26 07:31:33 +01:00
Check for trailing input garbage in tor_compress_impl() when decompressing
Fixes #22629.
This commit is contained in:
parent
8e1b37a4aa
commit
952c9073ad
1 changed files with 9 additions and 1 deletions
|
@ -138,9 +138,17 @@ tor_compress_impl(int compress,
|
||||||
case TOR_COMPRESS_OK:
|
case TOR_COMPRESS_OK:
|
||||||
if (compress || complete_only) {
|
if (compress || complete_only) {
|
||||||
goto err;
|
goto err;
|
||||||
|
} else {
|
||||||
|
if (in_len != 0) {
|
||||||
|
log_fn(protocol_warn_level, LD_PROTOCOL,
|
||||||
|
"Unexpected extra input while decompressing");
|
||||||
|
log_debug(LD_GENERAL, "method: %d level: %d at len: %zd",
|
||||||
|
method, compression_level, in_len);
|
||||||
|
goto err;
|
||||||
} else {
|
} else {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TOR_COMPRESS_BUFFER_FULL: {
|
case TOR_COMPRESS_BUFFER_FULL: {
|
||||||
if (!compress && outptr < *out+out_alloc) {
|
if (!compress && outptr < *out+out_alloc) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue