pidgin: 13d70522: Fix a possible malloc(0). Not too sure i...

qulogic at pidgin.im qulogic at pidgin.im
Thu Dec 22 04:41:05 EST 2011


----------------------------------------------------------------------
Revision: 13d705220c87a34a0e4f1bcecb6c5caddddf6518
Parent:   dd0f26da1468ff9191145d98d6b4d45d89e36e2a
Author:   qulogic at pidgin.im
Date:     12/22/11 02:14:31
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/13d705220c87a34a0e4f1bcecb6c5caddddf6518

Changelog: 

Fix a possible malloc(0). Not too sure if this can happen, though.

Changes against parent dd0f26da1468ff9191145d98d6b4d45d89e36e2a

  patched  libpurple/protocols/zephyr/ZRetSubs.c

-------------- next part --------------
============================================================
--- libpurple/protocols/zephyr/ZRetSubs.c	b6c6c255d2f68f39352d607b5f0f771b913016f6
+++ libpurple/protocols/zephyr/ZRetSubs.c	bf94a5ad9f51ef6496f629dc8aada60b8b8df160
@@ -132,6 +132,11 @@ static Code_t Z_RetSubs(notice, nsubs, a
 
 		__subscriptions_num = __subscriptions_num / 3;
 
+		if (!__subscriptions_num) {
+			ZFreeNotice(&retnotice);
+			continue;
+		}
+
 		__subscriptions_list = (ZSubscription_t *)
 			malloc((unsigned)(__subscriptions_num*
 					  sizeof(ZSubscription_t)));


More information about the Commits mailing list