aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/emulator/pcre/pcre_exec.c1
-rw-r--r--lib/stdlib/test/re_SUITE.erl18
2 files changed, 16 insertions, 3 deletions
diff --git a/erts/emulator/pcre/pcre_exec.c b/erts/emulator/pcre/pcre_exec.c
index 51625130c3..3fe13ca32e 100644
--- a/erts/emulator/pcre/pcre_exec.c
+++ b/erts/emulator/pcre/pcre_exec.c
@@ -5191,7 +5191,6 @@ for(;;)
EDEBUGF(("Loop limit break detected"));
return PCRE_ERROR_LOOP_LIMIT;
RESTART_INTERRUPTED:
- md->match_call_count = 0;
md->loop_limit = extra_data->loop_limit;
rc = match(NULL,NULL,NULL,0,md,0,NULL,0,0);
*extra_data->loop_counter_return =
diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl
index 4e78568a87..46a84d4e24 100644
--- a/lib/stdlib/test/re_SUITE.erl
+++ b/lib/stdlib/test/re_SUITE.erl
@@ -18,12 +18,12 @@
%%
-module(re_SUITE).
--export([all/1, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1]).
+-export([all/1, pcre/1,compile_options/1,run_options/1,combined_options/1,replace_autogen/1,global_capture/1,replace_input_types/1,replace_return/1,split_autogen/1,split_options/1,split_specials/1,error_handling/1,pcre_cve_2008_2371/1,pcre_compile_workspace_overflow/1,re_infinite_loop/1]).
-include("test_server.hrl").
-include_lib("kernel/include/file.hrl").
-all(suite) -> [pcre,compile_options,run_options,combined_options,replace_autogen,global_capture,replace_input_types,replace_return,split_autogen,split_options,split_specials,error_handling,pcre_cve_2008_2371,pcre_compile_workspace_overflow].
+all(suite) -> [pcre,compile_options,run_options,combined_options,replace_autogen,global_capture,replace_input_types,replace_return,split_autogen,split_options,split_specials,error_handling,pcre_cve_2008_2371,pcre_compile_workspace_overflow,re_infinite_loop].
pcre(doc) ->
["Run all applicable tests from the PCRE testsuites."];
@@ -552,3 +552,17 @@ pcre_compile_workspace_overflow(Config) when is_list(Config) ->
?line {error,{"internal error: overran compiling workspace",799}} =
re:compile([lists:duplicate(N, $(), lists:duplicate(N, $))]),
ok.
+re_infinite_loop(doc) ->
+ "Make sure matches that really loop infinitely actually fail";
+re_infinite_loop(Config) when is_list(Config) ->
+ Dog = ?t:timetrap(?t:minutes(1)),
+ ?line Str =
+ "http:/www.flickr.com/slideShow/index.gne?group_id=&user_id=69845378@N0",
+ ?line EMail_regex = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+"
+ ++ "(\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*"
+ ++ "@.*([a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+"
+ ++ "([a-zA-Z]{2}|com|org|net|gov|mil"
+ ++ "|biz|info|mobi|name|aero|jobs|museum)",
+ ?line nomatch = re:run(Str, EMail_regex),
+ ?t:timetrap_cancel(Dog),
+ ok.