From 854a73f8278effa811c911ab634dca69b1a670d7 Mon Sep 17 00:00:00 2001 From: Ilia Shipitsin Date: Wed, 10 Jul 2024 13:48:20 +0200 Subject: [PATCH] openvpn.c: handle strdup failure --- openvpn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openvpn.c b/openvpn.c index 8debf90c..dd96aa1e 100644 --- a/openvpn.c +++ b/openvpn.c @@ -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