summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2012-04-12 13:26:22 +0200
committerJiří Klimeš <jklimes@redhat.com>2012-04-12 13:45:58 +0200
commit21bc3ab517e9357674722616018777dcda62b4f8 (patch)
tree4aa113058c4d6cefd490b0777818501faad1d815
parent5f4d238baa4ef1b25c80074125ff67f4e609326b (diff)
ifnet: do not call g_strv_length() on NULL
-rw-r--r--src/settings/plugins/ifnet/net_utils.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/settings/plugins/ifnet/net_utils.c b/src/settings/plugins/ifnet/net_utils.c
index f1687479ed..d613db6a63 100644
--- a/src/settings/plugins/ifnet/net_utils.c
+++ b/src/settings/plugins/ifnet/net_utils.c
@@ -404,7 +404,7 @@ has_ip6_address (const char *conn_name)
g_return_val_if_fail (conn_name != NULL, FALSE);
ipset = split_addresses (ifnet_get_data (conn_name, "config"));
- length = g_strv_length (ipset);
+ length = ipset ? g_strv_length (ipset) : 0;
for (i = 0; i < length; i++) {
if (!is_ip6_address (ipset[i]))
continue;
@@ -618,7 +618,7 @@ convert_ip4_config_block (const char *conn_name)
g_return_val_if_fail (conn_name != NULL, NULL);
ipset = split_addresses (ifnet_get_data (conn_name, "config"));
- length = g_strv_length (ipset);
+ length = ipset ? g_strv_length (ipset) : 0;
routes = ifnet_get_data (conn_name, "routes");
if (routes)
@@ -654,7 +654,7 @@ convert_ip6_config_block (const char *conn_name)
g_return_val_if_fail (conn_name != NULL, NULL);
ipset = split_addresses (ifnet_get_data (conn_name, "config"));
- length = g_strv_length (ipset);
+ length = ipset ? g_strv_length (ipset) : 0;
for (i = 0; i < length; i++) {
ip = ipset[i];
ip = strip_string (ip, '"');
@@ -684,7 +684,7 @@ convert_ip4_routes_block (const char *conn_name)
g_return_val_if_fail (conn_name != NULL, NULL);
ipset = split_routes (ifnet_get_data (conn_name, "routes"));
- length = g_strv_length (ipset);
+ length = ipset ? g_strv_length (ipset) : 0;
for (i = 0; i < length; i++) {
ip = ipset[i];
if (find_default_gateway_str (ip) || strstr (ip, "::")
@@ -718,7 +718,7 @@ convert_ip6_routes_block (const char *conn_name)
g_return_val_if_fail (conn_name != NULL, NULL);
ipset = split_routes (ifnet_get_data (conn_name, "routes"));
- length = g_strv_length (ipset);
+ length = ipset ? g_strv_length (ipset) : 0;
for (i = 0; i < length; i++) {
ip = ipset[i];
ip = strip_string (ip, '"');