Future-proof and user-proof parse_bridge_line

This commit is contained in:
Nick Mathewson 2011-07-02 23:38:00 -04:00
parent c0de533c56
commit 7212538997

View File

@ -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 {