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.
master-1.22
Alexander von Gluck IV 2013-09-24 18:01:21 -05:00
parent 693f9ae54e
commit 707c3b56c0
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}