diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-03-17 13:56:10 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-03-17 13:56:10 -0400 |
commit | 4ee2699416dc612b859f6ba77e6fcd2e7e55c1b7 (patch) | |
tree | 7b1da16f8bdf2cc34370b9ab86f098483f276e7d | |
parent | e15a621ac81c472f69a082180fa9b4ed39274e43 (diff) | |
parent | cec647ff3eab20c97a744a59b808eb49760acfd3 (diff) | |
download | tor-4ee2699416dc612b859f6ba77e6fcd2e7e55c1b7.tar.gz tor-4ee2699416dc612b859f6ba77e6fcd2e7e55c1b7.zip |
Merge branch 'maint-0.4.1' into maint-0.4.2
-rw-r--r-- | changes/ticket33619 | 5 | ||||
-rw-r--r-- | src/core/or/circuitpadding.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/changes/ticket33619 b/changes/ticket33619 new file mode 100644 index 0000000000..3c52858b35 --- /dev/null +++ b/changes/ticket33619 @@ -0,0 +1,5 @@ + o Major bugfixes (circuit padding, memory leaks): + - Avoid a remotely triggered memory leak in the case that a circuit + padding machine is somehow negotiated twice on the same circuit. Fixes + bug 33619; bugfix on 0.4.0.1-alpha. Found by Tobias Pulls. This is + also tracked as TROVE-2020-004. diff --git a/src/core/or/circuitpadding.c b/src/core/or/circuitpadding.c index 99c68d5f6b..7f761fed6b 100644 --- a/src/core/or/circuitpadding.c +++ b/src/core/or/circuitpadding.c @@ -2444,9 +2444,12 @@ circpad_setup_machine_on_circ(circuit_t *on_circ, return; } - tor_assert_nonfatal(on_circ->padding_machine[machine->machine_index] - == NULL); - tor_assert_nonfatal(on_circ->padding_info[machine->machine_index] == NULL); + IF_BUG_ONCE(on_circ->padding_machine[machine->machine_index] != NULL) { + return; + } + IF_BUG_ONCE(on_circ->padding_info[machine->machine_index] != NULL) { + return; + } /* Log message */ if (CIRCUIT_IS_ORIGIN(on_circ)) { |