summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexParser.h
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-08-30 23:24:46 +0430
committerAndreas Kling <kling@serenityos.org>2021-08-31 16:37:49 +0200
commit05c65f9b5d80d93277ac15a7ec4161a3aad18415 (patch)
tree141e2400f9b3708313ba3f10b261d62a49dde9c6 /Userland/Libraries/LibRegex/RegexParser.h
parentc171aa40a8672930334a31fdfb15e9215d281e45 (diff)
downloadserenity-05c65f9b5d80d93277ac15a7ec4161a3aad18415.zip
LibRegex: Limit the number of nested capture groups allowed in BRE
Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4869334212673536
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexParser.h')
-rw-r--r--Userland/Libraries/LibRegex/RegexParser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibRegex/RegexParser.h b/Userland/Libraries/LibRegex/RegexParser.h
index 33bccca223..cc73fa8665 100644
--- a/Userland/Libraries/LibRegex/RegexParser.h
+++ b/Userland/Libraries/LibRegex/RegexParser.h
@@ -166,6 +166,7 @@ private:
constexpr static size_t number_of_addressable_capture_groups = 9;
size_t m_capture_group_minimum_lengths[number_of_addressable_capture_groups] { 0 };
bool m_capture_group_seen[number_of_addressable_capture_groups] { false };
+ size_t m_current_capture_group_depth { 0 };
};
class PosixExtendedParser final : public AbstractPosixParser {