check ast limits for create_parser_fuzzer

This commit is contained in:
Sema Checherinda 2022-11-22 15:46:21 +00:00 committed by Sema Checherinda
parent db1b971643
commit 4820cfbb91

View File

@ -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);