forked from boostorg/regex
Rework format string protection to be non-throwing.
Remove old test case, fix up tests to disable testing the new issues on the recursive implementation which will be going soon anyway.
This commit is contained in:
@ -52,6 +52,8 @@ void test_alt()
|
||||
TEST_REGEX_SEARCH("a\nb", egrep, "b", match_default, make_array(0, 1, -2, -2));
|
||||
TEST_REGEX_SEARCH("a\nb", egrep, "a", match_default, make_array(0, 1, -2, -2));
|
||||
// DOS protection:
|
||||
#ifndef BOOST_REGEX_RECURSIVE
|
||||
TEST_INVALID_REGEX("(|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||(?0))", perl);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,8 @@ void test_anchors()
|
||||
TEST_REGEX_SEARCH_W(L".$", boost::regex::extended, L" \x2028 \x2028", match_default, make_array(0, 1, -2, 2, 3, -2, 3, 4, -2, -2));
|
||||
#endif
|
||||
// DOS attack prevention:
|
||||
#ifndef BOOST_REGEX_RECURSIVE
|
||||
TEST_INVALID_REGEX("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", perl);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -194,5 +194,9 @@ void test_replace()
|
||||
TEST_REGEX_REPLACE("(a*)", perl, "aabb", match_default, "{$1}", "{aa}{}b{}b{}");
|
||||
TEST_REGEX_REPLACE("(a*)", boost::regex::extended, "aabb", match_default, "{$1}", "{aa}{}b{}b{}");
|
||||
TEST_REGEX_REPLACE("(a*)", boost::regex::extended, "aabb", match_default|match_posix, "{$1}", "{aa}b{}b{}");
|
||||
#ifndef BOOST_REGEX_RECURSIVE
|
||||
// DOS protection:
|
||||
TEST_REGEX_REPLACE("foo", boost::regex::perl, "foobar", match_default|format_all, "(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((", "(((((((((((((((((((((bar");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user