summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-06-02 21:23:40 -0400
committerAndreas Kling <kling@serenityos.org>2021-06-03 08:30:13 +0200
commita870eac0eb5b9ae2261554f5b40f1711c867cc1d (patch)
treed9fe326255b9e608c310c4b2763f9efd1013dbdf /Tests
parent0ff09d4f745c6418420a9224ee0f2587d806900c (diff)
downloadserenity-a870eac0eb5b9ae2261554f5b40f1711c867cc1d.zip
LibSQL: Report a syntax error for unsupported LIMIT clause syntax
Rather than aborting when a LIMIT clause of the form 'LIMIT expr, expr' is encountered, fail the parser with a syntax error. This will be nicer for the user and fixes the following fuzzer bug: https://crbug.com/oss-fuzz/34837
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibSQL/TestSqlStatementParser.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Tests/LibSQL/TestSqlStatementParser.cpp b/Tests/LibSQL/TestSqlStatementParser.cpp
index 64fbe3fb3e..bf262d4907 100644
--- a/Tests/LibSQL/TestSqlStatementParser.cpp
+++ b/Tests/LibSQL/TestSqlStatementParser.cpp
@@ -547,6 +547,7 @@ TEST_CASE(select)
EXPECT(parse("SELECT * FROM table LIMIT 12").is_error());
EXPECT(parse("SELECT * FROM table LIMIT 12 OFFSET;").is_error());
EXPECT(parse("SELECT * FROM table LIMIT 12 OFFSET 15").is_error());
+ EXPECT(parse("SELECT * FROM table LIMIT 15, 16;").is_error());
struct Type {
SQL::ResultType type;