Fix bugs reported by Will Drewry: certain invalid regexes can cause the library to access invalid memory, changed to ensure that the correct exception is thrown long before this happens.

[SVN r42674]
This commit is contained in:
John Maddock
2008-01-11 09:55:43 +00:00
parent 07eaac9e0e
commit 299086b99c
2 changed files with 22 additions and 0 deletions

View File

@ -121,6 +121,17 @@ void test_conditionals()
TEST_INVALID_REGEX("(?:(a)|b)(?(?:", perl);
TEST_INVALID_REGEX("(?:(a)|b)(?(?<", perl);
TEST_INVALID_REGEX("(?:(a)|b)(?(?<a", perl);
TEST_INVALID_REGEX("(?(?!#?)+)", perl);
TEST_INVALID_REGEX("(?(?=:-){0})", perl);
TEST_INVALID_REGEX("(?(123){1})", perl);
TEST_INVALID_REGEX("(?(?<=A)*)", perl);
TEST_INVALID_REGEX("(?(?<=A)+)", perl);
TEST_INVALID_REGEX("(?<!*|^)", perl);
TEST_INVALID_REGEX("(?<!*|A)", perl);
TEST_INVALID_REGEX("(?<=?|A)", perl);
TEST_INVALID_REGEX("(?<=*|\B)", perl);
}
void test_options()