[core,proxy] ignore empty variable

fixes #9928: ignore a defined but empty proxy environment variable
This commit is contained in:
akallabeth 2024-03-02 09:03:19 +01:00 committed by akallabeth
parent 4b2e192869
commit 3b108f1839

View File

@ -284,14 +284,12 @@ static BOOL check_no_proxy(rdpSettings* settings, const char* no_proxy)
void proxy_read_environment(rdpSettings* settings, char* envname)
{
DWORD envlen = 0;
char* env = NULL;
envlen = GetEnvironmentVariableA(envname, NULL, 0);
const DWORD envlen = GetEnvironmentVariableA(envname, NULL, 0);
if (!envlen)
if (!envlen || (envlen <= 1))
return;
env = calloc(1, envlen);
char* env = calloc(1, envlen);
if (!env)
{