summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexParser.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-08-11 18:06:33 -0400
committerLinus Groh <mail@linusgroh.de>2021-08-15 11:43:45 +0100
commit1a173be29d6ff8e9774b4a375b8de54d6849969c (patch)
tree404885ca2ae07d3c6fd75cadb79f190c0f1749a7 /Userland/Libraries/LibRegex/RegexParser.cpp
parentc3e1f1f687a3f2190cb666d73884b7884eeb5ad0 (diff)
downloadserenity-1a173be29d6ff8e9774b4a375b8de54d6849969c.zip
LibRegex: Disallow unescaped quantifiers in Unicode mode
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexParser.cpp')
-rw-r--r--Userland/Libraries/LibRegex/RegexParser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibRegex/RegexParser.cpp b/Userland/Libraries/LibRegex/RegexParser.cpp
index df58488a0c..84768cf121 100644
--- a/Userland/Libraries/LibRegex/RegexParser.cpp
+++ b/Userland/Libraries/LibRegex/RegexParser.cpp
@@ -1290,6 +1290,9 @@ bool ECMA262Parser::parse_atom(ByteCode& stack, size_t& match_length_minimum, bo
}
if (match(TokenType::RightBracket) || match(TokenType::RightCurly) || match(TokenType::LeftCurly)) {
+ if (unicode)
+ return set_error(Error::InvalidPattern);
+
if (m_should_use_browser_extended_grammar) {
auto token = consume();
match_length_minimum += 1;