Skip to content

Backport !1173 “gvariant: Limit recursion in g_variant_parse()” to glib-2-62

The token parsing done by g_variant_parse() uses recursive function calls, so at some point it will hit the stack limit. As with previous changes to GVariantType parsing (commit 7c4e6e9f), limit the level of nesting of containers parsed by g_variant_parse() to something reasonable. We guarantee 64 levels of nesting, which should be enough for anyone, and is the same as what we guarantee for types.

(Backport to 2.62: Dropped the new G_VARIANT_PARSE_ERROR_RECURSION error code in favour of G_VARIANT_PARSE_ERROR_FAILED, to avoid adding API.)

oss-fuzz#10286

Signed-off-by: Philip Withnall withnall@endlessm.com

Merge request reports