gysiang / minishell

0 stars 1 forks source link

Buffer Overflow on echo exit code ->$? #132

Closed axellee1994 closed 5 months ago

axellee1994 commented 5 months ago

image

@gysiang

gysiang commented 5 months ago

@axellee1994 What is this supposed to output?

axellee1994 commented 5 months ago

@gysiang

Testcase: echo "> >> < ? [ ] | ; [ ] || && ( ) & # $ \ <<" Bash Output: > >> < ? [ ] | ; [ ] || && ( ) & # $ \ <<

axellee1994 commented 5 months ago

@gysiang Can check the echo issues to test and see what the other outputs are for other testcases.

axellee1994 commented 5 months ago

Easier to visualise:

861b08cfa8b11a5fa1b7d9eb513ab58

gysiang commented 5 months ago

gyong-si@gyong-si:~/Documents/42/minishell$ echo "> >> < * ? [ ] | ; [ ] || && ( ) & # $ \ <<"

< ? [ ] | ; [ ] || && ( ) & # $ \ << gyong-si@gyong-si:~/Documents/42/minishell$ ./minishell minishell$ echo "> >> < ?"> >> < ? [ ] | ; [ ] || && ( ) & # $ \ <<" token: echo token type: 0 token: > >> < ? [ ] | ; [ ] || && ( ) & # $ \ << token type: 0 current token in process: echo < * ? [ ] | ; [ ] || && ( ) & # $ \ << No difference in output for the echo symbols