mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 21:01:24 +03:00
completion: correctly do a signed comparison, to avoid a segfault
Bug existed since commit 30fc197b
(a month ago) which changed the
type of 'i' from int to size_t, causing the comparison to do the
wrong thing when 'threshold' is negative.
This fixes https://savannah.gnu.org/bugs/?53722.
Reported-by: Devin Hussey <husseydevin@gmail.com>
This commit is contained in:
parent
0b6bb37c56
commit
d53086d38d
@ -3614,7 +3614,7 @@ void complete_a_word(void)
|
|||||||
/* The point where we can stop searching for shard. */
|
/* The point where we can stop searching for shard. */
|
||||||
|
|
||||||
/* Traverse the whole line, looking for shard. */
|
/* Traverse the whole line, looking for shard. */
|
||||||
for (i = pletion_x; i < threshold; i++) {
|
for (i = pletion_x; (int)i < threshold; i++) {
|
||||||
/* If the first byte doesn't match, run on. */
|
/* If the first byte doesn't match, run on. */
|
||||||
if (pletion_line->data[i] != shard[0])
|
if (pletion_line->data[i] != shard[0])
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user