Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed the array access beyond bounds.

  • Loading branch information...
commit 27812f06d11188314aed7c392bc268efd32bfa63 1 parent df9dd09
@shu223 shu223 authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  Model/GBMethodData.m
  2. +1 −1  Processing/GBCommentsProcessor.m
View
2  Model/GBMethodData.m
@@ -204,7 +204,7 @@ - (BOOL)formatTypesFromArray:(NSArray *)types toArray:(NSMutableArray *)array pr
if (isLast || isPointer) appendSpace = NO;
// We should not add space between components of a protocol (i.e. id<ProtocolName> should be written without any space). Because we've alreay
- if (!isLast && [[types objectAtIndex:idx+1] isEqualToString:@"<"])
+ if (!isLast && idx+1 < [types count] && [[types objectAtIndex:idx+1] isEqualToString:@"<"])
insideProtocol = YES;
else if ([type isEqualToString:@">"])
insideProtocol = NO;
View
2  Processing/GBCommentsProcessor.m
@@ -406,7 +406,7 @@ - (BOOL)processAvailabilityBlockInString:(NSString *)string lines:(NSArray *)lin
if ([components count] == 0) return NO;
// Get data from captures. Index 1 is directive, index 2 description text.
- NSString *description = [components objectAtIndex:3];
+ NSString *description = [components count] > 3 ? [components objectAtIndex:3] : @"";
NSRange range = [string rangeOfString:description];
NSString *prefix = nil;
if (range.location < [string length]) {
Please sign in to comment.
Something went wrong with that request. Please try again.