From ad4ae688c586819df1eb869b785650e5c8b7986d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 18 May 2021 20:21:23 -0500 Subject: [PATCH] Bugfix: Segfault from parameter being accessed when undefined. The parameter is not being existence checked when calling waitpid() and try to access parameter->wait. --- level_2/fll_execute/c/private-execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index f56d99d..c93b220 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -320,7 +320,7 @@ extern "C" { } // have the parent wait for the child process to finish. - waitpid(id_process, (int *) result, parameter->wait); + waitpid(id_process, (int *) result, parameter ? parameter->wait : 0); // this must explicitly check for 0 (as opposed to checking (!result)). if (result != 0) { -- 1.8.3.1