openvpn.c: handle strdup failure

pull/693/head
Ilia Shipitsin 2024-07-10 13:48:20 +02:00
parent 6794097462
commit 854a73f827
1 changed files with 5 additions and 0 deletions

View File

@ -1417,6 +1417,11 @@ OnPassword(connection_t *c, char *msg)
param->flags |= FLAG_CR_TYPE_SCRV1;
param->flags |= (*(chstr + 3) != '0') ? FLAG_CR_ECHO : 0;
param->str = strdup(chstr + 5);
if (!param->str)
{
WriteStatusLog(c, L"GUI> ", L"Error: Out of memory - ignoring dynamic challenge", false);
return;
}
LocalizedDialogBoxParamEx(ID_DLG_AUTH_CHALLENGE, c->hwndStatus, UserAuthDialogFunc, (LPARAM) param);
}
else