mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Future-proof and user-proof parse_bridge_line
This commit is contained in:
parent
c0de533c56
commit
7212538997
@ -4597,8 +4597,13 @@ parse_bridge_line(const char *line, int validate_only)
|
|||||||
field1 = smartlist_get(items, 0);
|
field1 = smartlist_get(items, 0);
|
||||||
smartlist_del_keeporder(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;
|
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);
|
addrport = smartlist_get(items, 0);
|
||||||
smartlist_del_keeporder(items, 0);
|
smartlist_del_keeporder(items, 0);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user