syamashi / minishell

minishell
2 stars 0 forks source link

[segmentation fault] minishell > >aaaaa #29

Closed syamashi closed 3 years ago

syamashi commented 3 years ago

minishell > >aaaaa

==1500== Invalid read of size 1 ==1500== at 0x483FED4: strcmp (vg_replace_strmem.c:849) ==1500== by 0x10EAFA: ft_strcmp (in /mnt/c/Users/shojiro/Desktop/42/minishell/git/minishell) ==1500== by 0x10DF1F: builtin_table (sh_launch_utils.c:48) ==1500== by 0x10DD82: sh_launch (sh_launch.c:67) ==1500== by 0x109783: minishell (minishell.c:122) ==1500== by 0x109424: main (main.c:19) ==1500== Address 0x0 is not stack'd, malloc'd or (recently) free'd

hariboten commented 3 years ago

exec->*argv == NULLのときにbuiltin_table()でstrcmpにNULLを送ってる気がする

hariboten commented 3 years ago

builtin_tableでNULLチェックすることで修正