From f509e395c1586193c6c5ffce1cb5d6da89c80703 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Tue, 24 Apr 2012 14:02:35 +0300 Subject: [PATCH] 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 --- src/timeserver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/timeserver.c b/src/timeserver.c index f39d64e..a821e2a 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(); -- 2.7.4