mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-12 23:53:46 +02: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,
|
guint indent,
|
||||||
GString *string_builder)
|
GString *string_builder)
|
||||||
{
|
{
|
||||||
|
gchar *tmp;
|
||||||
guint n;
|
guint n;
|
||||||
|
|
||||||
g_string_append_printf (string_builder, "%*s<annotation name=\"%s\" value=\"%s\"",
|
tmp = g_markup_printf_escaped ("%*s<annotation name=\"%s\" value=\"%s\"",
|
||||||
indent, "",
|
indent, "",
|
||||||
info->key,
|
info->key,
|
||||||
info->value);
|
info->value);
|
||||||
|
g_string_append (string_builder, tmp);
|
||||||
|
g_free (tmp);
|
||||||
|
|
||||||
if (info->annotations == NULL)
|
if (info->annotations == NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user