Fri, 21 Aug 2009 07:15:47 +0000
jabber: Fix a crash when the vcard includes an empty BINVAL.
Patch from Matthew Chapman. Closes #10003.
| COPYRIGHT | file | annotate | diff | comparison | revisions | |
| libpurple/protocols/jabber/buddy.c | file | annotate | diff | comparison | revisions |
--- a/COPYRIGHT Fri Aug 21 00:30:08 2009 +0000 +++ b/COPYRIGHT Fri Aug 21 07:15:47 2009 +0000 @@ -88,6 +88,7 @@ Matěj Cepl Cerulean Studios, LLC Jonathan Champ +Matthew Chapman Christophe Chapuis Patrick Cheung Ka-Hing Cheung
--- a/libpurple/protocols/jabber/buddy.c Fri Aug 21 00:30:08 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri Aug 21 07:15:47 2009 +0000 @@ -910,12 +910,14 @@ (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); + } } }