[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] extendcircuit and attachstream would complain about not eno...



Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	control.c 
Log Message:
extendcircuit and attachstream would complain about not enough
arguments, but then just keep on going anyway.


Index: control.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/control.c,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- control.c	11 Dec 2005 09:33:38 -0000	1.157
+++ control.c	12 Dec 2005 16:50:55 -0000	1.158
@@ -1536,8 +1536,12 @@
     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 @@
     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));