pidgin: 409aaedc: validates that string PurpleValues are u...

khc at pidgin.im khc at pidgin.im
Wed Dec 31 22:15:41 EST 2008


-----------------------------------------------------------------
Revision: 409aaedc8836828692279141224e2077ffd4a80f
Ancestor: 08eb4eb016e65c9a5fa6e226fd0fb4c9ebadcc31
Author: khc at pidgin.im
Date: 2009-01-01T03:09:10
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/409aaedc8836828692279141224e2077ffd4a80f

Modified files:
        libpurple/value.c

ChangeLog: 

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


-------------- next part --------------
============================================================
--- libpurple/value.c	38e4b961b6fb92aa8b7bb27b5d1ef0ab4eab243f
+++ libpurple/value.c	a0f522996e62f2fa8bc92ce830a0cd5326d4bb93
@@ -320,6 +320,7 @@ purple_value_set_string(PurpleValue *val
 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);


More information about the Commits mailing list