Skip to content

Commit

Permalink
Merge branch 'bug24826_031' into maint-0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Jan 18, 2018
2 parents af8cadf + 4bb831e commit f406b9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changes/bug24826_031
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
o Minor bugfixes (performance, fragile-hardening):
- Improve the performance of our consensus-diff application code when Tor
is built with the --enable-fragile-hardening option set. Fixes bug
24826; bugfix on 0.3.1.1-alpha.
5 changes: 4 additions & 1 deletion src/or/consdiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,8 +1285,11 @@ consdiff_apply_diff(const smartlist_t *cons1,
STATIC int
consensus_split_lines(smartlist_t *out, const char *s, memarea_t *area)
{
const char *end_of_str = s + strlen(s);
tor_assert(*end_of_str == '\0');

while (*s) {
const char *eol = strchr(s, '\n');
const char *eol = memchr(s, '\n', end_of_str - s);
if (!eol) {
/* File doesn't end with newline. */
return -1;
Expand Down

0 comments on commit f406b9d

Please sign in to comment.