[glib/wip/hadess/add-memory-monitor: 6/12] gvariant: Add guard to g_variant_get()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/hadess/add-memory-monitor: 6/12] gvariant: Add guard to g_variant_get()
- Date: Wed, 11 Dec 2019 11:43:05 +0000 (UTC)
commit 7c08580d80748dc679bb83eb2f945ca571fa9d3e
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 4 18:36:40 2019 +0100
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
glib/gvariant.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/glib/gvariant.c b/glib/gvariant.c
index d7ec8dc70..ee1a9c020 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]