summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-09-09 01:11:53 +0200
committerThomas Haller <thaller@redhat.com>2016-09-09 01:23:40 +0200
commit4a535e6213bb5de05f166c29debc65fc04a7a3b8 (patch)
treee54524512909ef840d639722b8009021f35c8484
parent0536525d98877129552fd4cd74b2cc0e7dae165a (diff)
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: 46665898bbe2c0998529cb75056d674654ba41a9 (cherry picked from commit 9cf9c3a88ed896df9133d41bac7065069bf49909)
-rw-r--r--libnm-core/nm-vpn-plugin-info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libnm-core/nm-vpn-plugin-info.c b/libnm-core/nm-vpn-plugin-info.c
index a4727619e..d3bc4893a 100644
--- a/libnm-core/nm-vpn-plugin-info.c
+++ b/libnm-core/nm-vpn-plugin-info.c
@@ -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));