summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-12-12 16:50:55 +0000
committerRoger Dingledine <arma@torproject.org>2005-12-12 16:50:55 +0000
commitea760fa14946cc34b7f897cd8a17dd6b9ccbc16a (patch)
tree9a6fc051d5ef07af3136f9523c976834f9d94a4a
parent27a201ac808b4e759495a1b36df80b823bb8f015 (diff)
downloadtor-ea760fa14946cc34b7f897cd8a17dd6b9ccbc16a.tar.gz
tor-ea760fa14946cc34b7f897cd8a17dd6b9ccbc16a.zip
extendcircuit and attachstream would complain about not enough
arguments, but then just keep on going anyway. svn:r5575
-rw-r--r--src/or/control.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 215abc745f..7fc2a2829e 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1536,8 +1536,12 @@ handle_control_extendcircuit(connection_t *conn, uint32_t len,
args = smartlist_create();
smartlist_split_string(args, body, " ",
SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
- if (smartlist_len(args)<2)
+ if (smartlist_len(args)<2) {
connection_printf_to_buf(conn,"512 Missing argument to EXTENDCIRCUIT\r\n");
+ SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
+ smartlist_free(args);
+ goto done;
+ }
zero_circ = !strcmp("0", (char*)smartlist_get(args,0));
if (!zero_circ && !(circ = get_circ(smartlist_get(args,0)))) {
@@ -1663,8 +1667,12 @@ handle_control_attachstream(connection_t *conn, uint32_t len,
args = smartlist_create();
smartlist_split_string(args, body, " ",
SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
- if (smartlist_len(args)<2)
+ if (smartlist_len(args)<2) {
connection_printf_to_buf(conn,"512 Missing argument to ATTACHSTREAM\r\n");
+ SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
+ smartlist_free(args);
+ return 0;
+ }
zero_circ = !strcmp("0", (char*)smartlist_get(args,1));