diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-02 23:38:00 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-03 00:02:13 -0400 |
commit | 72125389979af60b659dc469159ea9be397a2ffa (patch) | |
tree | 644ebcd82edd8b114021406ca24c5068da979fdf /src/or | |
parent | c0de533c56a02c5557236c5baac6b9d57133467f (diff) | |
download | tor-72125389979af60b659dc469159ea9be397a2ffa.tar.gz tor-72125389979af60b659dc469159ea9be397a2ffa.zip |
Future-proof and user-proof parse_bridge_line
Diffstat (limited to 'src/or')
-rw-r--r-- | 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 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 { |