]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Eat all whitespace after a control command
authorSebastian Hahn <sebastian@torproject.org>
Wed, 16 Nov 2011 16:44:20 +0000 (17:44 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Wed, 16 Nov 2011 17:14:06 +0000 (18:14 +0100)
src/or/control.c

index 4d86a23759520e365f240486e3a78a3b29468890..109eb8857b63c83cf6a7b5b967848cfbab194349 100644 (file)
@@ -1055,7 +1055,7 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
   int bad_cookie=0, bad_password=0;
   smartlist_t *sl = NULL;
 
-  if (!len || TOR_ISSPACE(body[0])) {
+  if (!len) {
     password = tor_strdup("");
     password_len = 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;
   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') {
+  while (TOR_ISSPACE(*args)) {
     ++args;
     --data_len;
   }