Permalink
Browse files

Fix another potential overflow crash.

  • Loading branch information...
msanders committed May 23, 2012
1 parent 2076033 commit 9a6a1f096db2023902da803e1bc0268b6ec133db
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/TapkuLibrary/TKCalendarMonthView.m
@@ -523,13 +523,12 @@ - (void) reactToTouch:(UITouch*)touch down:(BOOL)down{
[self addSubview:self.selectedImageView];
self.currentDay.text = [NSString stringWithFormat:@"%d",day];
+
+ NSInteger markOffset = row * 7 + column;
- if ([marks count] > 0) {
- if([[marks objectAtIndex: row * 7 + column] boolValue])
- [self.selectedImageView addSubview:self.dot];
- else
- [self.dot removeFromSuperview];
- }else{
+ if ([marks count] > markOffset && [[marks objectAtIndex:markOffset] boolValue]) {
+ [self.selectedImageView addSubview:self.dot];
+ } else {
[self.dot removeFromSuperview];
}

0 comments on commit 9a6a1f0

Please sign in to comment.