changeset 24854:647684cdbbac

validates that string PurpleValues are utf-8 status attributes use PurpleValue and this should prevent badly written plugins from putting invalid utf-8 in status.xml and subsequently causes pidgin not able to start
author Ka-Hing Cheung <khc@hxbc.us>
date Thu, 01 Jan 2009 03:09:10 +0000
parents b2f8b1e1e7cc
children cb274396158c
files libpurple/value.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/value.c	Thu Jan 01 01:04:34 2009 +0000
+++ b/libpurple/value.c	Thu Jan 01 03:09:10 2009 +0000
@@ -320,6 +320,7 @@
 purple_value_set_string(PurpleValue *value, const char *data)
 {
 	g_return_if_fail(value != NULL);
+	g_return_if_fail(data == NULL || g_utf8_validate(data, -1, NULL));
 
 	g_free(value->data.string_data);
 	value->data.string_data = g_strdup(data);