diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-12-02 13:19:21 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-12-02 13:19:21 -0500 |
commit | ee8f451bf1a8a0d01bb990ddf96f810a254394eb (patch) | |
tree | e934bc518715b58d8501806f0532fc43def2d700 /src | |
parent | 31b69027d39d0dc77dd1d8fd0895928768894654 (diff) | |
download | tor-ee8f451bf1a8a0d01bb990ddf96f810a254394eb.tar.gz tor-ee8f451bf1a8a0d01bb990ddf96f810a254394eb.zip |
Fix a harmless off-by-one error in counting controller argument lengths
Bugfix on 0.1.1.1-alpha; found by boboper.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/control.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c index 4d505a98fb..ad316c4ebc 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -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; |