summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-02-28 09:00:02 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-28 11:36:30 (GMT)
commit00881d31e4e7cbbc57a101e68099103e9604f9ca (patch)
tree2bc077f984969b72b5f47a0e2633096dddf185fc /vpn
parent885af894030d351393ecd2260494306b938e839f (diff)
downloadconnman-00881d31e4e7cbbc57a101e68099103e9604f9ca.zip
connman-00881d31e4e7cbbc57a101e68099103e9604f9ca.tar.gz
connman-00881d31e4e7cbbc57a101e68099103e9604f9ca.tar.bz2
vpn-provider: Parse user networks correctly
Check NULL string before passing it to g_strsplit()
Diffstat (limited to 'vpn')
-rw-r--r--vpn/vpn-provider.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index 0336636..3b0ab8f 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -1869,9 +1869,13 @@ static const char *get_string(GHashTable *settings, const char *key)
static GSList *parse_user_networks(const char *network_str)
{
GSList *networks = NULL;
- char **elems = g_strsplit(network_str, ",", 0);
+ char **elems;
int i = 0;
+ if (network_str == NULL)
+ return NULL;
+
+ elems = g_strsplit(network_str, ",", 0);
if (elems == NULL)
return NULL;