From a7717e3ea2abc8e702e29230857eed8ed0b99115 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 13 Feb 2013 17:29:02 +0200 Subject: [PATCH] pptp: Set the username/password before starting daemon This is required in order to avoid free memory access that is happening if we call vpn_provider_set_string() with same string that is already in the settings db. --- vpn/plugins/pptp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vpn/plugins/pptp.c b/vpn/plugins/pptp.c index c0d7c00..01b5e2b 100644 --- a/vpn/plugins/pptp.c +++ b/vpn/plugins/pptp.c @@ -441,10 +441,6 @@ static int run_connect(struct vpn_provider *provider, goto done; } - vpn_provider_set_string(provider, "PPTP.User", username); - vpn_provider_set_string_hide_value(provider, "PPTP.Password", - password); - DBG("username %s password %p", username, password); str = g_strdup_printf("%s %s --nolaunchpppd --loglevel 2", @@ -520,6 +516,10 @@ static void request_input_cb(struct vpn_provider *provider, else if (error != NULL) DBG("error %s", error); + vpn_provider_set_string(provider, "PPTP.User", username); + vpn_provider_set_string_hide_value(provider, "PPTP.Password", + password); + run_connect(provider, data->task, data->if_name, data->cb, data->user_data, username, password); -- 2.7.4