mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
protover: reject unexpected commas
Consistently reject extra commas, instead of only rejecting leading
commas.
Fix on b2b2e1c7f2.
Fixes #27194; bugfix on 0.2.9.4-alpha.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
o Minor bugfixes (protover):
|
||||
- Consistently reject extra commas, instead of only rejecting leading commas.
|
||||
Fixes bug 27194; bugfix on 0.2.9.4-alpha.
|
||||
@@ -245,7 +245,8 @@ parse_single_entry(const char *s, const char *end_of_entry)
|
||||
}
|
||||
|
||||
s = comma;
|
||||
while (*s == ',' && s < end_of_entry)
|
||||
// Skip the comma separator between ranges. Don't ignore a trailing comma.
|
||||
if (s < (end_of_entry - 1))
|
||||
++s;
|
||||
}
|
||||
|
||||
|
||||
@@ -572,6 +572,10 @@ test_protover_vote_roundtrip(void *args)
|
||||
{ "N-1=1,2", "N-1=1-2" },
|
||||
{ "-1=4294967295", NULL },
|
||||
{ "-1=3", "-1=3" },
|
||||
{ "Foo=,", NULL },
|
||||
{ "Foo=,1", NULL },
|
||||
{ "Foo=1,,3", NULL },
|
||||
{ "Foo=1,3,", NULL },
|
||||
/* junk. */
|
||||
{ "!!3@*", NULL },
|
||||
/* Missing equals sign */
|
||||
|
||||
Reference in New Issue
Block a user