Commit d53086d3 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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: default avatarDevin Hussey <husseydevin@gmail.com>
parent 0b6bb37c
Showing with 1 addition and 1 deletion
+1 -1
......@@ -3614,7 +3614,7 @@ void complete_a_word(void)
/* The point where we can stop searching 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 (pletion_line->data[i] != shard[0])
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment