mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Enforce multiplicity rules when parsing annotations.
We would never actually enforce multiplicity rules when parsing annotations, since the counts array never got entries added to it for annotations in the token list that got added by earlier calls to tokenize_string. Found by piebeer.
This commit is contained in:
@@ -3181,6 +3181,9 @@ tokenize_string(memarea_t *area,
|
||||
end = start+strlen(start);
|
||||
for (i = 0; i < _NIL; ++i)
|
||||
counts[i] = 0;
|
||||
|
||||
SMARTLIST_FOREACH(out, const directory_token_t *, t, ++counts[t->tp]);
|
||||
|
||||
while (*s < end && (!tok || tok->tp != _EOF)) {
|
||||
tok = get_next_token(area, s, end, table);
|
||||
if (tok->tp == _ERR) {
|
||||
|
||||
Reference in New Issue
Block a user