PrefPane: SCDynamicStoreCopyComputerName() can possibly return NULL, the function calls immediately below it are assuming it can't be NULL, result if it happens to be NULL is a crash. If it ends up being NULL we set it to the string localhost.
authorRudy Richter
Tue Sep 01 21:31:35 2009 -0400 (2009-09-01)
changeset 436388e9c44bbbdc
parent 4362 3c9edec57ae4
child 4364 b000509c2696
PrefPane: SCDynamicStoreCopyComputerName() can possibly return NULL, the function calls immediately below it are assuming it can't be NULL, result if it happens to be NULL is a crash. If it ends up being NULL we set it to the string localhost.
Core/Source/GrowlPreferencePane.m
     1.1 --- a/Core/Source/GrowlPreferencePane.m	Tue Sep 01 21:23:40 2009 -0400
     1.2 +++ b/Core/Source/GrowlPreferencePane.m	Tue Sep 01 21:31:35 2009 -0400
     1.3 @@ -944,8 +944,12 @@
     1.4  	}
     1.5  
     1.6  	// don't add the local machine
     1.7 -	CFStringRef localHostName = SCDynamicStoreCopyComputerName(/*store*/ NULL,
     1.8 +	CFStringRef localHostName = nil;
     1.9 +	localHostName = SCDynamicStoreCopyComputerName(/*store*/ NULL,
    1.10  															   /*nameEncoding*/ NULL);
    1.11 +	if(!localHostName)
    1.12 +		localHostName = CFSTR("localhost");
    1.13 +	
    1.14  	CFComparisonResult isLocalHost = CFStringCompare(localHostName, (CFStringRef)name, 0);
    1.15  	CFRelease(localHostName);
    1.16  	if (isLocalHost == kCFCompareEqualTo)