Fix for failure to check insertion point is at an existing item.

This commit is contained in:
Richard Frith-Macdonald 2017-11-16 14:56:20 +00:00
parent 7c68c30928
commit 9bbcd75d16
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2017-11-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSArray.m: Fix for bug reported on github by zneak.
2017-11-04 Fred Kiefer <fredkiefer@gmx.de>
* Source/GSLocale.m: Protect against

View file

@ -1204,6 +1204,10 @@ compare(id elem1, id elem2, void* context)
index--;
}
}
if (index >= NSMaxRange(range))
{
return NSNotFound;
}
/*
* For a search from the left, we'd have the correct index anyways. Check
* whether it's equal to the key and return NSNotFound otherwise