Merge remote-tracking branch 'tor-gitlab/mr/497' into main

This commit is contained in:
Alexander Færøy 2021-12-15 12:38:30 +00:00
commit 95b82c4fee
2 changed files with 7 additions and 1 deletions

6
changes/bug40472 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes (performance, DoS):
- Fix one case of a not-especially viable denial-of-service attack found
by OSS-Fuzz in our consensus-diff parsing code. This attack causes a
lot small of memory allocations and then immediately frees them: this
is only slow when running with all the sanitizers enabled. Fixes one
case of bug 40472; bugfix on 0.3.1.1-alpha.

View File

@ -1128,7 +1128,7 @@ consdiff_get_digests(const smartlist_t *diff,
{
const cdline_t *line2 = smartlist_get(diff, 1);
char *h = tor_memdup_nulterm(line2->s, line2->len);
smartlist_split_string(hash_words, h, " ", 0, 0);
smartlist_split_string(hash_words, h, " ", 0, 4);
tor_free(h);
}