From f768bd8091ca5f7a84ce06420c898f56ba5c5ab0 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 4 Jun 2020 13:43:31 +0200 Subject: [PATCH] shared: add FIXME about interpretation of variant-attribute bytestrings --- shared/nm-glib-aux/nm-shared-utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index 5b8f96b151..66147e60f1 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -4919,9 +4919,11 @@ _nm_utils_format_variant_attributes_full (GString *str, value = g_variant_get_boolean (variant) ? "true" : "false"; else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING)) value = g_variant_get_string (variant, NULL); - else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_BYTESTRING)) + else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_BYTESTRING)) { + /* FIXME: there is no guarantee that the byte array + * is valid UTF-8.*/ value = g_variant_get_bytestring (variant); - else + } else continue; if (sep)