mirror of https://github.com/OpenVPN/openvpn-gui
Replace % characters in param->id as it's used in format template
Found by ZeroPath Reported by: Joshua Rogers <joshua@joshua.hu> Signed-off-by: Selva Nair <selva.nair@gmail.com>master
parent
dab4dffa6b
commit
fff2048802
15
openvpn.c
15
openvpn.c
|
|
@ -75,6 +75,20 @@ static BOOL LaunchOpenVPN(connection_t *c);
|
|||
|
||||
const TCHAR *cfgProp = _T("conn");
|
||||
|
||||
/* Replace excluded characters by specified one */
|
||||
static void
|
||||
string_mod(char *in, const char *exclude, char replace)
|
||||
{
|
||||
while (*in)
|
||||
{
|
||||
if (strchr(exclude, *in))
|
||||
{
|
||||
*in = replace;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
free_auth_param(auth_param_t *param)
|
||||
{
|
||||
|
|
@ -997,6 +1011,7 @@ GenericPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
fmt = malloc(strlen(template) + strlen(param->id));
|
||||
if (fmt)
|
||||
{
|
||||
string_mod(param->id, "%", '_');
|
||||
sprintf(fmt, template, param->id);
|
||||
PrintDebug(L"Send passwd to mgmt with format: '%hs'", fmt);
|
||||
ManagementCommandFromInput(param->c, fmt, hwndDlg, ID_EDT_RESPONSE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue