changeset 28473:862467b37ee6

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
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Fri, 28 Aug 2009 20:30:03 +0000
parents f15a412c7748
children 708fd8138784 5901b1dd8d07
files libpurple/util.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/util.c	Fri Aug 28 16:15:40 2009 +0000
+++ b/libpurple/util.c	Fri Aug 28 20:30:03 2009 +0000
@@ -3129,6 +3129,12 @@
 	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));