From 4820cfbb91ac77a9a1fb1fadb3a72b2e915355fa Mon Sep 17 00:00:00 2001 From: Sema Checherinda Date: Tue, 22 Nov 2022 15:46:21 +0000 Subject: [PATCH] check ast limits for create_parser_fuzzer --- src/Parsers/fuzzers/create_parser_fuzzer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Parsers/fuzzers/create_parser_fuzzer.cpp b/src/Parsers/fuzzers/create_parser_fuzzer.cpp index 032d9ca3ffe..13cb1dfd36e 100644 --- a/src/Parsers/fuzzers/create_parser_fuzzer.cpp +++ b/src/Parsers/fuzzers/create_parser_fuzzer.cpp @@ -15,6 +15,12 @@ try DB::ParserCreateQuery parser; DB::ASTPtr ast = parseQuery(parser, input.data(), input.data() + input.size(), "", 0, 1000); + const UInt64 max_ast_depth = 1000; + ast->checkDepth(max_ast_depth); + + const UInt64 max_ast_elements = 50000; + ast->checkSize(max_ast_elements); + DB::WriteBufferFromOwnString wb; DB::formatAST(*ast, wb);