mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Prop140: Fix a crash bug.
Found while fuzzing: this could occur if we tried to copy a nonexistent "line 0" while applying a diff.
This commit is contained in:
parent
dd92579b63
commit
12d428aaff
@ -742,7 +742,7 @@ apply_ed_diff(const smartlist_t *cons1, const smartlist_t *diff,
|
||||
}
|
||||
|
||||
/* Add unchanged lines. */
|
||||
for (; j > end; --j) {
|
||||
for (; j && j > end; --j) {
|
||||
const char *cons_line = smartlist_get(cons1, j-1);
|
||||
smartlist_add(cons2, tor_strdup(cons_line));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user