From 707c3b56c0c68f12ca70dd6adadf27c6d1959021 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 24 Sep 2013 18:01:21 -0500 Subject: [PATCH] ay_to_strv: Prevent dereferencing a NULL pointer. * clang static analysis shows that ay_to_strv is called with argc set to NULL. This can cause ay_to_strv to dereference the pointer in a failure situation. --- src/terminal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/terminal.c b/src/terminal.c index 7434229..82af964 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -82,7 +82,8 @@ ay_to_strv (GVariant *variant, data = g_variant_get_fixed_array (variant, &data_len, sizeof (char)); if (data_len == 0 || data_len > G_MAXSSIZE) { - *argc = 0; + if (argc != NULL) + *argc = 0; return NULL; }