diff --git a/tests/Makefile b/tests/Makefile index b639228..ec4c042 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2,6 +2,7 @@ # file are prefixed with test_ rawtests = \ quote_removal \ + cmdlist_use_after_free \ metacharacters \ parse_command_lists \ parse_pipelines \ diff --git a/tests/cmdlist_use_after_free.c b/tests/cmdlist_use_after_free.c new file mode 100644 index 0000000..bc65e31 --- /dev/null +++ b/tests/cmdlist_use_after_free.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* cmdlist_use_after_free.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: khais +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/03/03 11:40:37 by khais #+# #+# */ +/* Updated: 2025/03/03 13:09:12 by khais ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "../src/parser/wordsplit/wordsplit.h" +#include "../src/parser/command_list/command_list.h" +#include "libft.h" +#include + +int main(void) +{ + t_wordlist *words = minishell_wordsplit("|"); + ft_printf("FINISHED PARSING WORDS!\n"); + t_cmdlist *cmd = cmdlist_from_wordlist(words); + assert(cmd == NULL); + return (0); +}