From 011c801f1d3b15860465311f541f4ec0c2d30920 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Thu, 30 Mar 2023 12:43:31 +0200 Subject: [PATCH] fix: first cmd not found cause invalide read --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 46bd576..e06c74f 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: cchauvet content; - if (content->own_cmd == 0 && content->pid != -1 - && content->fd_in[0] != -2 && content->fd_out[0] != -2) + if (content->executable != NULL && content->own_cmd == 0 + && content->pid != -1 && content->fd_in[0] != -2 && content->fd_out[0] != -2) { waitpid(content->pid, &exit_status, 0); if (WIFSIGNALED(exit_status))