mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Eat all whitespace after a control command
This commit is contained in:
parent
67650a869d
commit
7bd46344df
@ -1055,7 +1055,7 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
|
|||||||
int bad_cookie=0, bad_password=0;
|
int bad_cookie=0, bad_password=0;
|
||||||
smartlist_t *sl = NULL;
|
smartlist_t *sl = NULL;
|
||||||
|
|
||||||
if (!len || TOR_ISSPACE(body[0])) {
|
if (!len) {
|
||||||
password = tor_strdup("");
|
password = tor_strdup("");
|
||||||
password_len = 0;
|
password_len = 0;
|
||||||
} else if (TOR_ISXDIGIT(body[0])) {
|
} else if (TOR_ISXDIGIT(body[0])) {
|
||||||
@ -3118,7 +3118,7 @@ connection_control_process_inbuf(control_connection_t *conn)
|
|||||||
args = conn->incoming_cmd+cmd_len+1;
|
args = conn->incoming_cmd+cmd_len+1;
|
||||||
tor_assert(data_len>(size_t)cmd_len);
|
tor_assert(data_len>(size_t)cmd_len);
|
||||||
data_len -= (cmd_len+1); /* skip the command and NUL we added after it */
|
data_len -= (cmd_len+1); /* skip the command and NUL we added after it */
|
||||||
while (*args == ' ' || *args == '\t') {
|
while (TOR_ISSPACE(*args)) {
|
||||||
++args;
|
++args;
|
||||||
--data_len;
|
--data_len;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user