libnm-core: fix crash in nm_vpn_plugin_info_list_get_service_types()

Coverity says, "Dereference after null check". Indeed, @aliases
is usually NULL.

Fixes: 46665898bb
This commit is contained in:
Thomas Haller 2016-09-09 01:11:53 +02:00
parent 8bae6e588f
commit 9cf9c3a88e

View file

@ -738,7 +738,7 @@ nm_vpn_plugin_info_list_get_service_types (GSList *list,
n = _service_type_get_default_abbreviation (priv->service);
if (n)
g_ptr_array_add (l, g_strdup (n));
for (i = 0; priv->aliases[i]; i++) {
for (i = 0; priv->aliases && priv->aliases[i]; i++) {
n = _service_type_get_default_abbreviation (priv->aliases[i]);
if (n)
g_ptr_array_add (l, g_strdup (n));