TheSecretOrganization / minishell

MIT License
1 stars 2 forks source link

echo with no argument segfault #198

Closed Neffi42 closed 7 months ago

Neffi42 commented 7 months ago

==7130== Invalid read of size 1
==7130==    at 0x10952C: has_n_args (src/builtin/echo.c:19)
==7130==    by 0x109457: cmd_echo (src/builtin/echo.c:36)
==7130==    by 0x10A15B: exec_builtin (src/execution/builtin.c:35)
==7130==    by 0x10A7FE: dispatch_cmd (src/execution/dispatch.c:60)
==7130==    by 0x10E6BE: main (src/main.c:53)
==7130==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==7130==
==7130==
==7130== Process terminating with default action of signal 11 (SIGSEGV)
==7130==  Access not within mapped region at address 0x0
==7130==    at 0x10952C: has_n_args (src/builtin/echo.c:19)
==7130==    by 0x109457: cmd_echo (src/builtin/echo.c:36)
==7130==    by 0x10A15B: exec_builtin (src/execution/builtin.c:35)
==7130==    by 0x10A7FE: dispatch_cmd (src/execution/dispatch.c:60)
==7130==    by 0x10E6BE: main (src/main.c:53)
==7130==  If you believe this happened as a result of a stack
==7130==  overflow in your program's main thread (unlikely but
==7130==  possible), you can try to increase the size of the
==7130==  main thread stack using the --main-stacksize= flag.
==7130==  The main thread stack size used in this run was 8388608.```