From d27721296533ad892143793dbd283272d31a9494 Mon Sep 17 00:00:00 2001 From: Andrea Mambretti Date: Thu, 2 May 2024 09:24:05 +0000 Subject: [PATCH] libs2e: bugfix handling of S2E_MAX_PROCESS env strtol was always called even if S2E_MAX_PROCESS was not defined causing the preloading of the library to fail due to NULL ptr returned from getenv and passed straight in strtol. Fixed by checking for the correct variable. Signed-off-by: Andrea Mambretti --- libs2e/src/s2e-kvm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs2e/src/s2e-kvm.cpp b/libs2e/src/s2e-kvm.cpp index 8b474c287..a835d6d44 100644 --- a/libs2e/src/s2e-kvm.cpp +++ b/libs2e/src/s2e-kvm.cpp @@ -262,7 +262,7 @@ void S2EKVM::init(void) { int max_processes = 1; const char *max_processes_str = getenv("S2E_MAX_PROCESSES"); - if (max_processes) { + if (max_processes_str) { max_processes = strtol(max_processes_str, NULL, 0); }