[libcamera-devel] [PATCH 2/6] test: log: log_process: Fix uninitialized variable on process exit failure

Umang Jain umang.jain at ideasonboard.com
Fri Dec 8 08:11:36 CET 2023


Hi Laurent,

On 12/7/23 2:35 AM, Laurent Pinchart via libcamera-devel wrote:
> If the process fails to exit before the timeout, the
> LogProcessTest::exitStatus_ variable gets used uninitialized. Fix it by
> initializating to Process::NotExited.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>

> ---
>   test/log/log_process.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp
> index 17af7d74a1d5..f7635b70255c 100644
> --- a/test/log/log_process.cpp
> +++ b/test/log/log_process.cpp
> @@ -139,7 +139,7 @@ private:
>   	ProcessManager processManager_;
>   
>   	Process proc_;
> -	Process::ExitStatus exitStatus_;
> +	Process::ExitStatus exitStatus_ = Process::NotExited;
>   	string logPath_;
>   	int exitCode_;
>   	int num_;



More information about the libcamera-devel mailing list