[or-cvs] Accept 1.2.3.4/x as a synonym for 1.2.3.4/x:* .

Nick Mathewson nickm at seul.org
Sun Dec 14 00:04:31 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv15940/src/or

Modified Files:
	routerlist.c 
Log Message:
Accept 1.2.3.4/x as a synonym for 1.2.3.4/x:* .

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- routerlist.c	13 Dec 2003 08:06:03 -0000	1.9
+++ routerlist.c	14 Dec 2003 00:04:29 -0000	1.10
@@ -911,11 +911,13 @@
   address = arg;
   mask = strchr(arg,'/');
   port = strchr(mask?mask:arg,':');
-  if(!port)
-    goto policy_read_failed;
+  /* Break 'arg' into separate strings.  'arg' was already strdup'd by 
+   * _router_get_next_token, so it's safe to modify.
+   */
   if (mask)
     *mask++ = 0;
-  *port++ = 0;
+  if (port)
+    *port++ = 0;
 
   if (strcmp(address, "*") == 0) {
     newe->addr = 0;
@@ -945,7 +947,7 @@
       goto policy_read_failed;
     }
   }
-  if (strcmp(port, "*") == 0) {
+  if (!port || strcmp(port, "*") == 0) {
     newe->prt_min = 1;
     newe->prt_max = 65535;
   } else {



More information about the tor-commits mailing list