From: Nick Mathewson Date: Sun, 3 Jul 2011 03:38:00 +0000 (-0400) Subject: Future-proof and user-proof parse_bridge_line X-Git-Tag: tor-0.2.3.2-alpha~27^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72125389979af60b659dc469159ea9be397a2ffa;p=thirdparty%2Ftor.git Future-proof and user-proof parse_bridge_line --- diff --git a/src/or/config.c b/src/or/config.c index a94abb0501..0082ff9397 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 {