From: Kevin Day Date: Wed, 19 May 2021 01:21:23 +0000 (-0500) Subject: Bugfix: Segfault from parameter being accessed when undefined. X-Git-Tag: 0.5.4~32 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=ad4ae688c586819df1eb869b785650e5c8b7986d;p=fll Bugfix: Segfault from parameter being accessed when undefined. The parameter is not being existence checked when calling waitpid() and try to access parameter->wait. --- 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) {