On 13 Feb 2014, at 15:25, Mathias Bauer <[email protected]> wrote:

> Hi dear list members,
> 
> I came across the following code in NSPredicate.m:
> 
> ( it's in
> - (BOOL) _evaluateLeftValue: (id)leftResult
>                rightValue: (id)rightResult
>                    object: (id)object
> line 968ff.)
> 
>>      case NSEndsWithPredicateOperatorType:
>>      {
>>        NSRange range;
>> 
>>        range = NSMakeRange([leftResult length] - [rightResult length],
>>          [rightResult length]);
>>        return ([leftResult compare: rightResult
>>                            options: compareOptions
>>                              range: range] == NSOrderedSame ? YES : NO);
>>      }
> 
> IMHO there needs to be a check whether rightResult is longer than leftResult, 
> as in this case NSMakeRange will throw an exception.

Thanks, I added a check as you suggest.
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to