prometheus/promql
Tobias Guggenmos f5eed7ae0a PromQL: Fix panic in parser (#6650)
Fixes #6649.

The crash is fixed here, was caused because some  AST sanity checks were performed on the syntax tree while assembling it. In case of previous parsing errors this could lead to undefined behaviour.

The fix is to move the checks to the typechecking phase, which runs only when a syntax tree was assembled without there being parsing errors.

There are other places, where similiar checks are performed while assembling the syntax tree. It might be a good idea to move those to the typechecking phase, too. Should I do this in the same or a separate PR?

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
2020-01-17 13:06:26 +00:00
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
testdata PromQL: Fix string and parentheses handling in engine (#6612) 2020-01-15 18:31:58 +01:00
ast.go PromQL: Add position metadata to the AST (#6615) 2020-01-14 16:12:15 +00:00
bench_test.go add absent_over_time (#6490) 2020-01-03 15:26:12 +00:00
engine.go PromQL: Fix string and parentheses handling in engine (#6612) 2020-01-15 18:31:58 +01:00
engine_test.go Add query log (#6520) 2020-01-08 13:28:43 +00:00
functions.go PromQL: AST: Make VectorSelector Children of MatrixSelector (#6590) 2020-01-10 14:25:41 +00:00
functions_test.go Refactor testutil.NewStorage into a new package 2019-08-08 19:43:04 -06:00
fuzz.go fix fuzz targets (#5851) 2019-08-12 20:47:57 +02:00
generated_parser.y PromQL: Don't panic on syntax errors (#6643) 2020-01-16 15:20:20 +00:00
generated_parser.y.go PromQL: Don't panic on syntax errors (#6643) 2020-01-16 15:20:20 +00:00
lex.go PromQL: Use PositionRange in parser errors (#6634) 2020-01-15 20:01:49 +00:00
lex_test.go PromQL: Avoid lexer item copies and allocations (#6584) 2020-01-09 11:26:58 +00:00
parse.go PromQL: Fix panic in parser (#6650) 2020-01-17 13:06:26 +00:00
parse_test.go PromQL: Fix panic in parser (#6650) 2020-01-17 13:06:26 +00:00
printer.go PromQL: AST: Make VectorSelector Children of MatrixSelector (#6590) 2020-01-10 14:25:41 +00:00
printer_test.go fix subquery with offset conversion to string (#6373) 2019-11-26 06:45:51 +00:00
promql_test.go promql: Move tests to testutil (#6103) 2019-10-09 18:06:53 -06:00
quantile.go func name ref correct "qauntile" -> "quantile" (#5834) 2019-08-06 06:11:16 +01:00
query_logger.go Query Logging styling (#6594) 2020-01-09 21:11:39 +00:00
query_logger_test.go Query Logging styling (#6594) 2020-01-09 21:11:39 +00:00
test.go PromQL: Use PositionRange in parser errors (#6634) 2020-01-15 20:01:49 +00:00
test_test.go Fix some spelling issues (#5361) 2019-03-14 14:38:54 +00:00
value.go promql: fix typo in value.go (#6491) 2019-12-19 22:30:32 +00:00