pidgin: 5ca4fe18: jabber: Fix a crash when the vcard inclu...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Aug 21 04:01:07 EDT 2009


-----------------------------------------------------------------
Revision: 5ca4fe18a853bb7a6d9c45cd96ce2e9da4a2f8b8
Ancestor: 6082171acfbee6eca0da0fc109d9c79563a234df
Author: darkrain42 at pidgin.im
Date: 2009-08-21T07:15:47
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5ca4fe18a853bb7a6d9c45cd96ce2e9da4a2f8b8

Modified files:
        COPYRIGHT libpurple/protocols/jabber/buddy.c

ChangeLog: 

jabber: Fix a crash when the vcard includes an empty BINVAL.

Patch from Matthew Chapman. Closes #10003.

-------------- next part --------------
============================================================
--- COPYRIGHT	ab199bb2b059d3e01ced086ca5f9ccb17b4e775d
+++ COPYRIGHT	dfc8e62b34734f33919dc152cb4b27a6416ef046
@@ -88,6 +88,7 @@ Jonathan Champ
 Mat?j Cepl
 Cerulean Studios, LLC
 Jonathan Champ
+Matthew Chapman
 Christophe Chapuis
 Patrick Cheung
 Ka-Hing Cheung
============================================================
--- libpurple/protocols/jabber/buddy.c	4cfcb34fc77eba427d8df1dca407ee1477d277c7
+++ libpurple/protocols/jabber/buddy.c	1a562a47cd324202e118ad51c42f5c38e285b1db
@@ -910,12 +910,14 @@ static void jabber_vcard_save_mine(Jabbe
 	             (binval = xmlnode_get_child(photo, "BINVAL"))) {
 		gsize size;
 		char *bintext = xmlnode_get_data(binval);
-		guchar *data = purple_base64_decode(bintext, &size);
-		g_free(bintext);
+		if (bintext) {
+			guchar *data = purple_base64_decode(bintext, &size);
+			g_free(bintext);
 
-		if (data) {
-			vcard_hash = jabber_calculate_data_sha1sum(data, size);
-			g_free(data);
+			if (data) {
+				vcard_hash = jabber_calculate_data_sha1sum(data, size);
+				g_free(data);
+			}
 		}
 	}
 


More information about the Commits mailing list