Java: Add test case.

This commit is contained in:
Geoffrey White
2023-07-20 11:43:11 +01:00
parent 0a0e9bb25b
commit 32c10885d4

View File

@@ -86,6 +86,9 @@ class ExpRedosTest {
// NOT GOOD; attack: "\n".repeat(100) + "." // NOT GOOD; attack: "\n".repeat(100) + "."
"(?s)(.|\\n)*!", // $ hasExpRedos "(?s)(.|\\n)*!", // $ hasExpRedos
// NOT GOOD; attack: "\n".repeat(100) + "."
"(?is)(.|\\n)*!", // $ MISSING: hasExpRedos
// GOOD // GOOD
"([\\w.]+)*", "([\\w.]+)*",
@@ -120,7 +123,7 @@ class ExpRedosTest {
"\"((?:\\\\[\\x00-\\x7f]|[^\\x00-\\x08\\x0a-\\x1f\\x7f\"])*)\"", // $ MISSING: hasExpRedos "\"((?:\\\\[\\x00-\\x7f]|[^\\x00-\\x08\\x0a-\\x1f\\x7f\"])*)\"", // $ MISSING: hasExpRedos
// GOOD // GOOD
"\"((?:\\\\[\\x00-\\x7f]|[^\\x00-\\x08\\x0a-\\x1f\\x7f\"\\\\])*)\"", "\"((?:\\\\[\\x00-\\x7f]|[^\\x00-\\x08\\x0a-\\x1f\\x7f\"\\\\])*)\"",
// NOT GOOD // NOT GOOD
"(([a-z]|[d-h])*)\"", // $ hasExpRedos "(([a-z]|[d-h])*)\"", // $ hasExpRedos