mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Fix a harmless off-by-one error in counting controller argument lengths
Bugfix on 0.1.1.1-alpha; found by boboper.
This commit is contained in:
parent
31b69027d3
commit
ee8f451bf1
5
changes/bytecount
Normal file
5
changes/bytecount
Normal file
@ -0,0 +1,5 @@
|
||||
o Minor bugfixes
|
||||
- Fix a off-by-one error in calculating some controller command argument
|
||||
lengths. Fortunately, this is harmless, the controller code does
|
||||
redundant NUL termination too. Found by boboper. Bugfix on
|
||||
0.1.1.1-alpha.
|
@ -2855,9 +2855,10 @@ connection_control_process_inbuf(control_connection_t *conn)
|
||||
&& !TOR_ISSPACE(conn->incoming_cmd[cmd_len]))
|
||||
++cmd_len;
|
||||
|
||||
data_len -= cmd_len;
|
||||
conn->incoming_cmd[cmd_len]='\0';
|
||||
args = conn->incoming_cmd+cmd_len+1;
|
||||
tor_assert(data_len>(size_t)cmd_len);
|
||||
data_len -= (cmd_len+1); /* skip the command and NUL we added after it */
|
||||
while (*args == ' ' || *args == '\t') {
|
||||
++args;
|
||||
--data_len;
|
||||
|
Loading…
Reference in New Issue
Block a user