mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibSQL: Limit the number of nested subqueries
SQLite hasn't documented a limit on https://www.sqlite.org/limits.html for the maximum number of nested subqueries. However, its parser is generated with Yacc and has an internal limit of 100 for general nested statements. Fixes https://crbug.com/oss-fuzz/35022.
This commit is contained in:
committed by
Andreas Kling
parent
4e974e6d60
commit
c7cd81bce8
@@ -738,3 +738,10 @@ TEST_CASE(common_table_expression)
|
||||
validate("WITH table (column1, column2) AS (SELECT * FROM table) DELETE FROM table;", { false, { { "table", { "column1", "column2" } } } });
|
||||
validate("WITH RECURSIVE table AS (SELECT * FROM table) DELETE FROM table;", { true, { { "table", {} } } });
|
||||
}
|
||||
|
||||
TEST_CASE(nested_subquery_limit)
|
||||
{
|
||||
auto subquery = String::formatted("{:(^{}}table{:)^{}}", "", SQL::Limits::maximum_subquery_depth - 1, "", SQL::Limits::maximum_subquery_depth - 1);
|
||||
EXPECT(!parse(String::formatted("SELECT * FROM {};", subquery)).is_error());
|
||||
EXPECT(parse(String::formatted("SELECT * FROM ({});", subquery)).is_error());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user