Skip to content

Commit

Permalink
libs2e: bugfix handling of S2E_MAX_PROCESS env
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
m4mbr3 authored and vitalych committed May 2, 2024
1 parent 2d21ad6 commit 3063162
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs2e/src/s2e-kvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3063162

Please sign in to comment.