gdbusmessage: Limit recursion of variants in D-Bus messages
This is the analogue of commit 7c4e6e9f, but applied to the
GDBusMessage
parser, which does its own top-level parsing of the
variant format in D-Bus messages.
Previously, this code allowed arbitrary recursion of variant containers, which could lead to a stack overflow. Now, that recursion is limited to 64 levels, as per the D-Bus specification:
https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-marshaling-signature
This includes a new unit test.
oss-fuzz#14870
Signed-off-by: Philip Withnall withnall@endlessm.com