summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/RegexTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/RegexTest.cpp')
-rw-r--r--llvm/unittests/Support/RegexTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/Support/RegexTest.cpp b/llvm/unittests/Support/RegexTest.cpp
index 5e3ce39f005..7e44a3c0614 100644
--- a/llvm/unittests/Support/RegexTest.cpp
+++ b/llvm/unittests/Support/RegexTest.cpp
@@ -171,4 +171,12 @@ TEST_F(RegexTest, MatchInvalid) {
EXPECT_FALSE(r1.match("X"));
}
+// https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3727
+TEST_F(RegexTest, OssFuzz3727Regression) {
+ // Wrap in a StringRef so the NUL byte doesn't terminate the string
+ Regex r(StringRef("[[[=GS\x00[=][", 10));
+ std::string Error;
+ EXPECT_FALSE(r.isValid(Error));
+}
+
}
OpenPOWER on IntegriCloud