summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-09-18 04:29:59 +0000
committerRoger Dingledine <arma@torproject.org>2006-09-18 04:29:59 +0000
commit83eb9f98dda8440565133633088ffdedbbc4a5e6 (patch)
tree6f1962e1dcd14b6472ceb10173e7e1e259244dc4
parent9373e0d332c66cd8917c8e4a9da7588fa0d7fd55 (diff)
downloadtor-83eb9f98dda8440565133633088ffdedbbc4a5e6.tar.gz
tor-83eb9f98dda8440565133633088ffdedbbc4a5e6.zip
minimal backport: don't crash when extendcircuit gets a third arg.
svn:r8413
-rw-r--r--src/or/control.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/control.c b/src/or/control.c
index bcb6addef6..55b4fc01bb 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1703,18 +1703,20 @@ handle_control_extendcircuit(connection_t *conn, uint32_t len,
}
smartlist_split_string(router_nicknames, smartlist_get(args,1), ",", 0, 0);
- SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
- smartlist_free(args);
- if (!zero_circ && !circ) {
- goto done;
- }
if (zero_circ && smartlist_len(args)>2) {
if (get_purpose(smartlist_get(args,2), 1, &intended_purpose) < 0) {
connection_printf_to_buf(conn, "552 Unknown purpose \"%s\"\r\n",
(char *)smartlist_get(args,2));
+ SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
+ smartlist_free(args);
goto done;
}
}
+ SMARTLIST_FOREACH(args, char *, cp, tor_free(cp));
+ smartlist_free(args);
+ if (!zero_circ && !circ) {
+ goto done;
+ }
}
routers = smartlist_create();