adium 5519:541ecd4ba9a7: Don't create a dictionary with a nil ob...

commits at adium.im commits at adium.im
Thu May 30 17:01:19 UTC 2013


details:	http://hg.adium.im/adium/rev/541ecd4ba9a7
revision:	5519:541ecd4ba9a7
branch:		adium-1.6
author:		Frank Dowsett <wixardy at adium.im>
date:		Thu May 30 12:59:34 2013 -0400

Don't create a dictionary with a nil object. Fixes #16400
Subject: adium 5520:868232f2e8ef: Fix some analyzer issues.

details:	http://hg.adium.im/adium/rev/868232f2e8ef
revision:	5520:868232f2e8ef
branch:		adium-1.6
author:		Frank Dowsett <wixardy at adium.im>
date:		Thu May 30 13:01:02 2013 -0400

Fix some analyzer issues.

diffs (72 lines):

diff -r 5cd72bf325c6 -r 868232f2e8ef Frameworks/AIUtilities Framework/Source/AIStringAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m	Thu May 23 22:25:59 2013 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m	Thu May 30 13:01:02 2013 -0400
@@ -508,7 +508,7 @@
 #define SBEFS_BOUNDARY_GUARD \
 	do { \
 		if (i == buflen) { \
-			buf = realloc(buf, sizeof(unichar) * (buflen += buflenIncrement)); \
+			buf = reallocf(buf, sizeof(unichar) * (buflen += buflenIncrement)); \
 			if (buf == NULL) { \
 				NSLog(@"in stringByEscapingForShell: could not allocate %lu bytes", (unsigned long)(sizeof(unichar) * buflen)); \
 				free(myBuf); \
@@ -591,7 +591,7 @@
 #define SBEFR_BOUNDARY_GUARD \
 do { \
 if (i == buflen) { \
-buf = realloc(buf, sizeof(unichar) * (buflen += buflenIncrement)); \
+buf = reallocf(buf, sizeof(unichar) * (buflen += buflenIncrement)); \
 if (!buf) { \
 NSLog(@"in stringByEscapingForRegexp: could not allocate %lu bytes", (unsigned long)(sizeof(unichar) * buflen)); \
 free(myBuf); \
diff -r 5cd72bf325c6 -r 868232f2e8ef Frameworks/Adium Framework/Source/AIContactObserverManager.m
--- a/Frameworks/Adium Framework/Source/AIContactObserverManager.m	Thu May 23 22:25:59 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContactObserverManager.m	Thu May 30 13:01:02 2013 -0400
@@ -246,20 +246,17 @@
         }
 	}
 
+	NSDictionary *keys = (inModifiedKeys ? [NSDictionary dictionaryWithObject:inModifiedKeys forKey:@"Keys"] : nil);
 	//Post an attributes changed message
 	[[NSNotificationCenter defaultCenter] postNotificationName:ListObject_AttributesChanged
 														object:inObject
-													  userInfo:(inModifiedKeys ?
-																[NSDictionary dictionaryWithObject:inModifiedKeys
-																							forKey:@"Keys"] :
-																nil)];
-	 
+													  userInfo:keys];
+	
 	if (!shouldDelay) {
 		/* Note that we completed 1 or more delayed attribute changes */
 		[[NSNotificationCenter defaultCenter] postNotificationName:ListObject_AttributeChangesComplete
 															object:inObject
-														  userInfo:[NSDictionary dictionaryWithObject:inModifiedKeys
-																							   forKey:@"Keys"]];
+														  userInfo:keys];
 	}
 }
 
diff -r 5cd72bf325c6 -r 868232f2e8ef Source/AIListLayoutWindowController.m
--- a/Source/AIListLayoutWindowController.m	Thu May 23 22:25:59 2013 +0200
+++ b/Source/AIListLayoutWindowController.m	Thu May 30 13:01:02 2013 -0400
@@ -492,7 +492,7 @@
 
 - (void)updateUserIconMenuFromPrefDict:(NSDictionary *)prefDict
 {
-	NSInteger userIconPositionChoices[3];
+	NSInteger userIconPositionChoices[3] = {-1};
 	
 	if ([[adium.preferenceController preferenceForKey:KEY_LIST_LAYOUT_WINDOW_STYLE group:PREF_GROUP_APPEARANCE] integerValue] != AIContactListWindowStyleContactBubbles_Fitted) {
 		userIconPositionChoices[0] = LIST_POSITION_LEFT;
diff -r 5cd72bf325c6 -r 868232f2e8ef Source/AIMessageViewEmoticonsController.m
--- a/Source/AIMessageViewEmoticonsController.m	Thu May 23 22:25:59 2013 +0200
+++ b/Source/AIMessageViewEmoticonsController.m	Thu May 30 13:01:02 2013 -0400
@@ -50,6 +50,7 @@
  */
 - (id)initWithNibName:(NSString *)nibName textView:(AIMessageEntryTextView *)aView atPoint:(NSPoint)aPoint
 {
+	self = [super init];
 	if ([[NSBundle mainBundle] loadNibFile:nibName
 						 externalNameTable:[NSDictionary dictionaryWithObjectsAndKeys:self, NSNibOwner, AI_topLevelObjects, NSNibTopLevelObjects, nil]
 								  withZone:nil]) {




More information about the commits mailing list