filtering: when returning to a line number, ensure it is within range
The function line_from_number() can handle only line numbers that exist, and will crash otherwise. (The lack of checks makes the function fast.) This fixes https://savannah.gnu.org/bugs/?63120. Bug existed since commit d1e28417 from five weeks ago.
This commit is contained in:
parent
119ec47072
commit
d4d2840f5d
@ -747,7 +747,11 @@ void goto_line_posx(ssize_t linenumber, size_t pos_x)
|
|||||||
recook |= perturbed;
|
recook |= perturbed;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
openfile->current = line_from_number(linenumber);
|
if (linenumber < openfile->filebot->lineno)
|
||||||
|
openfile->current = line_from_number(linenumber);
|
||||||
|
else
|
||||||
|
openfile->current = openfile->filebot;
|
||||||
|
|
||||||
openfile->current_x = pos_x;
|
openfile->current_x = pos_x;
|
||||||
openfile->placewewant = xplustabs();
|
openfile->placewewant = xplustabs();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user