From: Patrik Flykt Date: Tue, 24 Apr 2012 11:02:35 +0000 (+0300) Subject: timeserver: Fix NULL network struct access for VPN X-Git-Tag: 2.0_alpha~353 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f509e395c1586193c6c5ffce1cb5d6da89c80703;p=framework%2Fconnectivity%2Fconnman.git 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 --- 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();