pidgin: 2c240182: g_utf8_normalize() for glib ver < 2.15.0...

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Fri Aug 28 16:36:08 EDT 2009


-----------------------------------------------------------------
Revision: 2c2401820569b102feeb7ce574b90abdc6406f99
Ancestor: e629b65820b00815f72db648e751403c2e642e2e
Author: sulabh at soc.pidgin.im
Date: 2009-08-28T20:30:03
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2c2401820569b102feeb7ce574b90abdc6406f99

Modified files:
        libpurple/util.c

ChangeLog: 

g_utf8_normalize() for glib ver < 2.15.0 causes a crash when an invalid utf8 string is passed to it (http://bugzilla.gnome.org/show_bug.cgi?id=501997).
Returning NULL when str is NULL, should prevent a few crashes, see #10115

-------------- next part --------------
============================================================
--- libpurple/util.c	c307654b2a9f5ff33dca165ad5597830a0bd7539
+++ libpurple/util.c	550b810b97856ff3828884587969e257b5d107e0
@@ -3129,6 +3129,12 @@ purple_normalize(const PurpleAccount *ac
 	const char *ret = NULL;
 	static char buf[BUF_LEN];
 
+	/* g_utf8_normalize() for glib ver < 2.15.0 causes a crash when an invalid utf8 string is passed to it
+	   (http://bugzilla.gnome.org/show_bug.cgi?id=501997).
+	   Returning NULL when str is NULL, should prevent a few crashes, see #10115 */
+	if(!str)
+		return NULL;
+
 	if (account != NULL)
 	{
 		PurplePlugin *prpl = purple_find_prpl(purple_account_get_protocol_id(account));


More information about the Commits mailing list