diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-04-24 14:02:35 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-04-24 13:25:18 +0200 |
commit | f509e395c1586193c6c5ffce1cb5d6da89c80703 (patch) | |
tree | 4d3fe0c08f421c6c742cfe0941871c83b442dbcc /src/timeserver.c | |
parent | acabaf2dce1435f112c44529129ba66425ffe4c0 (diff) | |
download | connman-f509e395c1586193c6c5ffce1cb5d6da89c80703.tar.gz connman-f509e395c1586193c6c5ffce1cb5d6da89c80703.tar.bz2 connman-f509e395c1586193c6c5ffce1cb5d6da89c80703.zip |
timeserver: Fix NULL network struct access for VPN
A VPN does not have a network struct set. Thus do not attempt to
look up the corresponding interface index for a NULL network
pointer.
Fixes BMC#25075
Diffstat (limited to 'src/timeserver.c')
-rw-r--r-- | src/timeserver.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/timeserver.c b/src/timeserver.c index f39d64ec..a821e2a1 100644 --- a/src/timeserver.c +++ b/src/timeserver.c @@ -186,14 +186,14 @@ GSList *__connman_timeserver_get_all(struct connman_service *service) list = g_slist_prepend(list, g_strdup(service_ts[i])); network = __connman_service_get_network(service); + if (network != NULL) { + index = connman_network_get_index(network); + service_gw = __connman_ipconfig_get_gateway_from_index(index); - index = connman_network_get_index(network); - - service_gw = __connman_ipconfig_get_gateway_from_index(index); - - /* Then add Service Gateway to the list */ - if (service_gw != NULL) - list = g_slist_prepend(list, g_strdup(service_gw)); + /* Then add Service Gateway to the list */ + if (service_gw != NULL) + list = g_slist_prepend(list, g_strdup(service_gw)); + } /* Then add Global Timeservers to the list */ timeservers = load_timeservers(); |