[folks] PotentialMatch: use a correct index upper bound.
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] PotentialMatch: use a correct index upper bound.
- Date: Wed, 3 Jan 2018 23:20:01 +0000 (UTC)
commit 765febf7a02adf62b01f86eb4e7dbfd548b4e99d
Author: Niels De Graef <nielsdegraef gmail com>
Date: Wed Jan 3 23:19:31 2018 +0100
PotentialMatch: use a correct index upper bound.
This is probably the root cause for bug 739997[1].
[1]: https://bugzilla.gnome.org/show_bug.cgi?id=739997
folks/potential-match.vala | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/folks/potential-match.vala b/folks/potential-match.vala
index 2148269..ecaf349 100644
--- a/folks/potential-match.vala
+++ b/folks/potential-match.vala
@@ -669,7 +669,7 @@ public class Folks.PotentialMatch : Object
if (pos < haystack_len && ch == c)
return 0;
- uint idx = ((int) pos - (int) max_dist).clamp (0, haystack_len);
+ uint idx = ((int) pos - (int) max_dist).clamp (0, haystack_len - 1);
ch = 0;
while (idx < pos + max_dist && (ch = haystack[idx]) != 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]