comparison libpurple/util.c @ 28120: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 6b018d1efc5c
children 5901b1dd8d07
comparison
equal deleted inserted replaced
28114:f15a412c7748 28120:862467b37ee6
3127 purple_normalize(const PurpleAccount *account, const char *str) 3127 purple_normalize(const PurpleAccount *account, const char *str)
3128 { 3128 {
3129 const char *ret = NULL; 3129 const char *ret = NULL;
3130 static char buf[BUF_LEN]; 3130 static char buf[BUF_LEN];
3131 3131
3132 /* g_utf8_normalize() for glib ver < 2.15.0 causes a crash when an invalid utf8 string is passed to it
3133 (http://bugzilla.gnome.org/show_bug.cgi?id=501997).
3134 Returning NULL when str is NULL, should prevent a few crashes, see #10115 */
3135 if(!str)
3136 return NULL;
3137
3132 if (account != NULL) 3138 if (account != NULL)
3133 { 3139 {
3134 PurplePlugin *prpl = purple_find_prpl(purple_account_get_protocol_id(account)); 3140 PurplePlugin *prpl = purple_find_prpl(purple_account_get_protocol_id(account));
3135 3141
3136 if (prpl != NULL) 3142 if (prpl != NULL)