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:33:59 2009 -0400 (2009-09-01)
changeset 4364b000509c2696
parent 4363 88e9c44bbbdc
child 4365 82f50f3678bb
child 5611 d855ec88f48f
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:31:35 2009 -0400
     1.2 +++ b/Core/Source/GrowlPreferencePane.m	Tue Sep 01 21:33:59 2009 -0400
     1.3 @@ -948,7 +948,7 @@
     1.4  	localHostName = SCDynamicStoreCopyComputerName(/*store*/ NULL,
     1.5  															   /*nameEncoding*/ NULL);
     1.6  	if(!localHostName)
     1.7 -		localHostName = CFSTR("localhost");
     1.8 +		localHostName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("localhost"));
     1.9  	
    1.10  	CFComparisonResult isLocalHost = CFStringCompare(localHostName, (CFStringRef)name, 0);
    1.11  	CFRelease(localHostName);