diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-02 10:41:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-25 14:13:03 -0400 |
commit | dbfe1a14e44647a4d5f27f8d495f3468208d75dd (patch) | |
tree | 019b889b40e0390898c3ae18ad4132926c4b4d91 /src/core/mainloop | |
parent | f18b7dc4731bcb853db92a0faaa4ec03d6ef5586 (diff) | |
download | tor-dbfe1a14e44647a4d5f27f8d495f3468208d75dd.tar.gz tor-dbfe1a14e44647a4d5f27f8d495f3468208d75dd.zip |
When parsing a multiline controller command, be careful with linebreaks
The first line break in particular was mishandled: it was discarded
if no arguments came before it, which made it impossible to
distinguish arguments from the first line of the body.
To solve this, we need to allocate a copy of the command rather than
using NUL to separate it, since we might have "COMMAND\n" as our input.
Fixes ticket 29984.
Diffstat (limited to 'src/core/mainloop')
-rw-r--r-- | src/core/mainloop/connection.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index 51c19b4c4c..30504e4edb 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -697,6 +697,7 @@ connection_free_minimal(connection_t *conn) control_connection_t *control_conn = TO_CONTROL_CONN(conn); tor_free(control_conn->safecookie_client_hash); tor_free(control_conn->incoming_cmd); + tor_free(control_conn->current_cmd); if (control_conn->ephemeral_onion_services) { SMARTLIST_FOREACH(control_conn->ephemeral_onion_services, char *, cp, { memwipe(cp, 0, strlen(cp)); |