redirection parsing: check for null in arguments

This commit is contained in:
Khaïs COLIN 2025-03-10 16:42:53 +01:00
parent d9dfac106d
commit 47ac767f2a
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
2 changed files with 13 additions and 4 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/07 12:30:04 by khais #+# #+# */
/* Updated: 2025/03/11 14:57:56 by khais ### ########.fr */
/* Updated: 2025/03/11 14:58:11 by khais ### ########.fr */
/* */
/* ************************************************************************** */
@ -71,6 +71,8 @@ struct s_simple_cmd *parse_redirections(struct s_simple_cmd *cmd)
t_redir_type type;
size_t i;
if (cmd == NULL)
return (NULL);
i = 0;
while (wordlist_get(cmd->words, i) != NULL)
{