Robustify against tickets containing bundle IDs that aren't strings.
authorPeter Hosey <hg@boredzo.org>
Sat Apr 24 18:21:01 2010 -0700 (2010-04-24)
changeset 4614e423155bfdf1
parent 4613 9bf3d74dc04f
child 4615 90ee4e5f7fd4
Robustify against tickets containing bundle IDs that aren't strings.
Core/Source/GrowlApplicationTicket.m
     1.1 --- a/Core/Source/GrowlApplicationTicket.m	Sun Apr 18 22:53:57 2010 -0700
     1.2 +++ b/Core/Source/GrowlApplicationTicket.m	Sat Apr 24 18:21:01 2010 -0700
     1.3 @@ -63,6 +63,11 @@
     1.4  
     1.5  		appName = [getObjectForKey(ticketDict, GROWL_APP_NAME) retain];
     1.6  		appId = [getObjectForKey(ticketDict, GROWL_APP_ID) retain];
     1.7 +		if (appId && ![appId isKindOfClass:[NSString class]]) {
     1.8 +			NSLog(@"Ticket for application %@ contains invalid bundle ID %@! Rejecting.", appName, appId);
     1.9 +			[self release];
    1.10 +			return nil;
    1.11 +		}
    1.12  
    1.13  		humanReadableNames = [[ticketDict objectForKey:GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES] retain];
    1.14  		notificationDescriptions = [[ticketDict objectForKey:GROWL_NOTIFICATIONS_DESCRIPTIONS] retain];