GNOME Bugzilla – Bug 721796
insufficient escaping in g_dbus_annotation_info_generate_xml()
Last modified: 2014-01-09 03:58:27 UTC
Having (XML) special characters in the value of an annotation can result in GDBus sending a malformed XML document in response to the Introspect call. This is caused by insufficient escaping in g_dbus_annotation_info_generate_xml(): g_string_append_printf (string_builder, "%*s<annotation name=\"%s\" value=\"%s\"", indent, "", info->key, info->value); We should probably markup-escape the info->value here before inserting it into the string.
Created attachment 265720 [details] [review] gdbus: properly escape introspection annotations Make sure we escape any special characters that are found in annotation names or values to avoid emitting a malformed XML document in response to an Introspect call.
Created attachment 265721 [details] [review] gdbus-introspection test: test escaping attributes Make sure attribute values are properly escaped in generated XML.
Review of attachment 265720 [details] [review]: yes
Review of attachment 265721 [details] [review]: nice
Attachment 265720 [details] pushed as 04ee782 - gdbus: properly escape introspection annotations Attachment 265721 [details] pushed as 8bc63b0 - gdbus-introspection test: test escaping attributes