summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexLexer.cpp
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-08-30 20:20:58 +0430
committerAndreas Kling <kling@serenityos.org>2021-08-30 18:43:09 +0200
commit206bc01f81f2efe0e8fb237149e3ce0556602e4b (patch)
tree1d67f4a80e01178beba33ee896d8ee487e5ec036 /Userland/Libraries/LibRegex/RegexLexer.cpp
parent0de35db0f19cad50dfb35660d4d860f7a55649cc (diff)
downloadserenity-206bc01f81f2efe0e8fb237149e3ce0556602e4b.zip
LibRegex: Allow null bytes in pattern
That check was rather pointless as the input is a StringView which knows its own bounds. Fixes #9686.
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexLexer.cpp')
-rw-r--r--Userland/Libraries/LibRegex/RegexLexer.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibRegex/RegexLexer.cpp b/Userland/Libraries/LibRegex/RegexLexer.cpp
index 69b2b4d345..671e2cb4fa 100644
--- a/Userland/Libraries/LibRegex/RegexLexer.cpp
+++ b/Userland/Libraries/LibRegex/RegexLexer.cpp
@@ -109,7 +109,7 @@ Token Lexer::next()
}
};
- while (m_index <= m_input.length()) {
+ while (m_index < m_input.length()) {
auto ch = peek();
if (ch == '(')
return emit_token(TokenType::LeftParen);
@@ -175,9 +175,6 @@ Token Lexer::next()
}
}
- if (ch == '\0')
- break;
-
return emit_token(TokenType::Char);
}