mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Future-proof and user-proof parse_bridge_line
This commit is contained in:
+6
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user