mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
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. https://bugzilla.gnome.org/show_bug.cgi?id=721796
This commit is contained in:
parent
3872049445
commit
04ee782486
@ -583,12 +583,15 @@ g_dbus_annotation_info_generate_xml (GDBusAnnotationInfo *info,
|
||||
guint indent,
|
||||
GString *string_builder)
|
||||
{
|
||||
gchar *tmp;
|
||||
guint n;
|
||||
|
||||
g_string_append_printf (string_builder, "%*s<annotation name=\"%s\" value=\"%s\"",
|
||||
indent, "",
|
||||
info->key,
|
||||
info->value);
|
||||
tmp = g_markup_printf_escaped ("%*s<annotation name=\"%s\" value=\"%s\"",
|
||||
indent, "",
|
||||
info->key,
|
||||
info->value);
|
||||
g_string_append (string_builder, tmp);
|
||||
g_free (tmp);
|
||||
|
||||
if (info->annotations == NULL)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user