diff options
author | Rickard Green <[email protected]> | 2017-04-05 14:32:16 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-04-07 15:02:10 +0200 |
commit | 8f452530e61b299d4d48f82f41ab5364723607ae (patch) | |
tree | 29bc2e4cfac2bcd5fdc4cdee4996a39350a1a32a /lib/stdlib/test/re_SUITE.erl | |
parent | 671d690debf653a6b1e86c3e7880b9c5640b1324 (diff) | |
download | otp-8f452530e61b299d4d48f82f41ab5364723607ae.tar.gz otp-8f452530e61b299d4d48f82f41ab5364723607ae.tar.bz2 otp-8f452530e61b299d4d48f82f41ab5364723607ae.zip |
Stack guard for PCRE
Diffstat (limited to 'lib/stdlib/test/re_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/re_SUITE.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl index 464027bade..a76ded5f60 100644 --- a/lib/stdlib/test/re_SUITE.erl +++ b/lib/stdlib/test/re_SUITE.erl @@ -612,9 +612,15 @@ pcre_cve_2008_2371(Config) when is_list(Config) -> %% http://vcs.pcre.org/viewvc/code/trunk/pcre_compile.c?r1=504&r2=505&view=patch pcre_compile_workspace_overflow(Config) when is_list(Config) -> N = 819, - {error,{"regular expression is too complicated",799}} = - re:compile([lists:duplicate(N, $(), lists:duplicate(N, $))]), - ok. + ExpStr = "Got expected error: ", + case re:compile([lists:duplicate(N, $(), lists:duplicate(N, $))]) of + {error, {"regular expression is too complicated" = Str,799}} -> + {comment, ExpStr ++ Str}; + {error, {"parentheses are too deeply nested (stack check)" = Str, _No}} -> + {comment, ExpStr ++ Str}; + Other -> + ?t:fail({unexpected, Other}) + end. %% Make sure matches that really loop infinitely actually fail. re_infinite_loop(Config) when is_list(Config) -> |