gvariant: Add guard to g_variant_get()

Even if g_variant_get_va(), which we eventually call, checks on the
validity of the value argument, check it early to avoid surprises, such
as this intermittent FreeBSD test failure:
(/var/tmp/gitlab_runner/builds/3fe11159/0/GNOME/glib/_build/gio/tests/gdbus-connection:65788): GLib-CRITICAL **: 15:13:25.670: g_variant_get_va: assertion 'value != NULL' failed
This commit is contained in:
Bastien Nocera 2019-12-04 18:36:40 +01:00
parent 75e29305b8
commit 43d3d49234

View File

@ -5434,6 +5434,7 @@ g_variant_get (GVariant *value,
{
va_list ap;
g_return_if_fail (value != NULL);
g_return_if_fail (valid_format_string (format_string, TRUE, value));
/* if any direct-pointer-access formats are in use, flatten first */