GNOME Bugzilla – Bug 792185
PotentialMatch clamps array index to wrong upper bound
Last modified: 2018-01-04 11:14:37 UTC
Created attachment 366265 [details] [review] [Patch] Change the upper bound to the correct number. As noted in bug 739997, GNOME Contacts has been experiencing crashes, which seem to stem from Folks.PotentialMatch. After some investigation, I found out that the `_contains`-method contains a wrong indexing logic. As noted in the commit message, the upper bound is wrongfully set to the length of the array (it should be the length - 1). Attached is a patch which should fix the problem. Assuming no other problems pop up by handling this, this would fix an annoying crash in GNOME Contacts for some people.
Review of attachment 366265 [details] [review]: Good fix, thanks a lot for the patch.
Comment on attachment 366265 [details] [review] [Patch] Change the upper bound to the correct number. Landed on master as commit 765febf.
Excellent, thanks. I’ll try and make a release in the next few weeks (so if you have any other bugs/fixes to get in, please let me know!).
Thanks for the quick review! At the moment, the only bugs I can think of that I would like to get in before the release are the ones I just posted (another indexing error and the display_name patch).