summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-03-17 14:25:37 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-17 17:48:15 +0100
commit3300c18821cb8fb8045c49c48a5c2386aea9a537 (patch)
tree2e712e15e67a2ca939c13b00a8976dec19bb268c /plugins
parent26a9401f56669417f2a4bc73e2401272f56faafb (diff)
downloadconnman-3300c18821cb8fb8045c49c48a5c2386aea9a537.tar.gz
connman-3300c18821cb8fb8045c49c48a5c2386aea9a537.tar.bz2
connman-3300c18821cb8fb8045c49c48a5c2386aea9a537.zip
vpn: Fix possible null pointer dereference
Reported by: DJ Cozatt <ygdrasil@comcast.net>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/vpn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/vpn.c b/plugins/vpn.c
index 4685b513..b75df05d 100644
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
@@ -106,14 +106,16 @@ void vpn_died(struct connman_task *task, int exit_code, void *user_data)
{
struct connman_provider *provider = user_data;
struct vpn_data *data = connman_provider_get_data(provider);
- int state = data->state;
+ int state = VPN_STATE_FAILURE;
enum connman_provider_error ret;
DBG("provider %p data %p", provider, data);
- if (!data)
+ if (data == NULL)
goto vpn_exit;
+ state = data->state;
+
kill_tun(data->if_name);
connman_provider_set_data(provider, NULL);
connman_rtnl_remove_watch(data->watch);