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

[tor-commits] [tor/master] Future-proof and user-proof parse_bridge_line



commit 72125389979af60b659dc469159ea9be397a2ffa
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Sat Jul 2 23:38:00 2011 -0400

    Future-proof and user-proof parse_bridge_line
---
 src/or/config.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index a94abb0..0082ff9 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4597,8 +4597,13 @@ parse_bridge_line(const char *line, int validate_only)
   field1 = smartlist_get(items, 0);
   smartlist_del_keeporder(items, 0);
 
-  if (!strstr(field1, ".")) { /* new-style bridge line */
+  if (!(strstr(field1, ".") || strstr(field1, ":"))) {
+    /* new-style bridge line */
     transport_name = field1;
+    if (smartlist_len(items) < 1) {
+      log_warn(LD_CONFIG, "Too few items to Bridge line.");
+      goto err;
+    }
     addrport = smartlist_get(items, 0);
     smartlist_del_keeporder(items, 0);
   } else {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits