From 03d613a3fa91c4d8cd7742a8edcff5875a0a3cce Mon Sep 17 00:00:00 2001 From: drahwanj Date: Mon, 19 May 2025 10:00:17 +0300 Subject: [PATCH] update(heredoc): added integer safe for heredoc file names --- src/parse_redir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/parse_redir.c b/src/parse_redir.c index 124e72e..2891b47 100644 --- a/src/parse_redir.c +++ b/src/parse_redir.c @@ -94,6 +94,8 @@ int parse_redir(t_shell *shell, t_pak **curr, t_token **token) } else if ((*token)->type == TK_HEREDOC) { + if (shell->heredoc > 2147483646) + shell->heredoc = 0; filename = get_heredoc_file(++(shell->heredoc)); parse_heredoc(shell, curr, token, filename); free(filename);