New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON.sh does crash when parsing numerous nested structures #47

Open
nst opened this Issue Oct 18, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@nst

nst commented Oct 18, 2016

Step to reproduce

$ python -c "print('['*100000)" | ./JSON.sh 

Expected behaviour

JSON.sh should either parse the string, or return an error.

Actual behaviour

./JSON.sh: line 206: 40694 Done                    tokenize
40695 Segmentation fault: 11  | parse

JSON.sh does crash because it lacks a nesting limit.

@dominictarr

This comment has been minimized.

Show comment
Hide comment
@dominictarr

dominictarr Oct 18, 2016

Owner

I don't think we could have a nesting limit, other than exiting when it was reached, because even if you wanted to scan and not parse things beneath the limit, you'd still need to make sure the brackets balanced.

Owner

dominictarr commented Oct 18, 2016

I don't think we could have a nesting limit, other than exiting when it was reached, because even if you wanted to scan and not parse things beneath the limit, you'd still need to make sure the brackets balanced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment