Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the array access beyond bounds. #308

Merged
merged 1 commit into from Feb 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Model/GBMethodData.m
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Processing/GBCommentsProcessor.m
Expand Up @@ -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]) {
Expand Down