From 691f81f5c1a148a4e07681d7c27d407d6f493af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Sat, 1 Feb 2020 08:29:46 +0100 Subject: [PATCH] Fixed segfault in Environment.GetEnvironmentVariables on POSIX --- BeefySysLib/platform/posix/PosixCommon.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BeefySysLib/platform/posix/PosixCommon.cpp b/BeefySysLib/platform/posix/PosixCommon.cpp index 852e19ce..58ebfee5 100644 --- a/BeefySysLib/platform/posix/PosixCommon.cpp +++ b/BeefySysLib/platform/posix/PosixCommon.cpp @@ -658,6 +658,9 @@ BFP_EXPORT void BFP_CALLTYPE BfpSystem_GetEnvironmentStrings(char* outStr, int* while (true) { char* envStr = *envPtr; + if (envStr == NULL) + break; + env.Append(envStr, strlen(envStr) + 1); ++envPtr; }