Commit 1d87c6c7 authored by Allison Karlitskaya's avatar Allison Karlitskaya

GVariant parser: turn two asserts into soft errors

Parsing wrongly-typed GVariant text format data is a well-defined
operation and it ought to result in a GError.  We do that for most
cases, but 'v' and 'ay' were being treated differently.  Fix those as
parent c70b4978
......@@ -1142,7 +1142,9 @@ variant_get_value (AST *ast,
Variant *variant = (Variant *) ast;
GVariant *child;
g_assert (g_variant_type_equal (type, G_VARIANT_TYPE_VARIANT));
if (!g_variant_type_equal (type, G_VARIANT_TYPE_VARIANT))
return ast_type_error (ast, type, error);
child = ast_resolve (variant->value, error);
if (child == NULL)
......@@ -1656,7 +1658,8 @@ bytestring_get_value (AST *ast,
ByteString *string = (ByteString *) ast;
g_assert (g_variant_type_equal (type, G_VARIANT_TYPE_BYTESTRING));
if (!g_variant_type_equal (type, G_VARIANT_TYPE_BYTESTRING))
return ast_type_error (ast, type, error);
return g_variant_new_bytestring (string->string);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment