mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user