Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4

This commit is contained in:
Nick Mathewson 2014-04-29 13:02:18 -04:00
commit 1d3ffc0ec9
2 changed files with 7 additions and 0 deletions

5
changes/md_leak_bug Normal file
View File

@ -0,0 +1,5 @@
o Major bugfixes (security, OOM)
- Fix a memory leak that could occur if a microdescriptor parse
fails during the tokenizing step. This could enable a memory
exhaustion attack by directory servers. Fixes bug #11649; bugfix
on 0.2.2.6-alpha.

View File

@ -4374,11 +4374,13 @@ microdescs_parse_from_string(const char *s, const char *eos,
microdesc_free(md);
md = NULL;
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
memarea_clear(area);
smartlist_clear(tokens);
s = start_of_next_microdesc;
}
SMARTLIST_FOREACH(tokens, directory_token_t *, t, token_clear(t));
memarea_drop_all(area);
smartlist_free(tokens);