expressions: Parse multiple sets of parentheses for grouping together.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 6 Oct 2021 05:15:28 +0000 (22:15 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 6 Oct 2021 05:15:28 +0000 (22:15 -0700)
commitbc0434f1ced83fc3a5f5ace44cbad3acdc5e3e29
treec56880ffab7d8ff919c7ee747378e1053c85a936
parenteeedca3fcd959f73ba2c2fd4cbab5bd03ceb4f8d
expressions: Parse multiple sets of parentheses for grouping together.

Fuzzers are fond of driving expression parsers to failure by exhausting
the stack in trivial ways.  This defeats the simplest attempts by
lining up thousands of left parentheses in a row.

I am a bit curious whether the fuzzer will now invent something more
sophisticated, such as nested function calls or non-empty expressions like
1+(1+(1+(1+(1+....

This fixes bug #61286.
Thanks to Irfan Ariq for reporting the bug.
src/language/expressions/parse.c