diff options
| author | jvoisin | 2017-10-25 14:22:56 +0200 |
|---|---|---|
| committer | GitHub | 2017-10-25 14:22:56 +0200 |
| commit | 5c841311bd762afc9c0edd46e65e2a8dcf109e68 (patch) | |
| tree | 3632f08c843d8fdafe70c1a279b1ffc4bf4e549a | |
| parent | 30b900fedc5b1584b4d352d47ec3f9406d558be5 (diff) | |
.drop() is now bailout
Courtesy of @buixor
| -rw-r--r-- | src/sp_execute.c | 2 | ||||
| -rw-r--r-- | src/tests/disabled_functions_chain.phpt | 4 | ||||
| -rw-r--r-- | src/tests/disabled_functions_chain_call_user_func.phpt | 4 | ||||
| -rw-r--r-- | src/tests/disabled_functions_method.phpt | 2 | ||||
| -rw-r--r-- | src/tests/disabled_functions_param_array.phpt | 8 | ||||
| -rw-r--r-- | src/tests/disabled_functions_param_int.phpt | 4 |
6 files changed, 4 insertions, 20 deletions
diff --git a/src/sp_execute.c b/src/sp_execute.c index fb4a313..6345da8 100644 --- a/src/sp_execute.c +++ b/src/sp_execute.c | |||
| @@ -57,7 +57,7 @@ static void sp_execute_ex(zend_execute_data *execute_data) { | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | if (true == should_disable(execute_data)) { | 59 | if (true == should_disable(execute_data)) { |
| 60 | return; | 60 | sp_terminate(); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | if (execute_data->func->op_array.type == ZEND_EVAL_CODE) { | 63 | if (execute_data->func->op_array.type == ZEND_EVAL_CODE) { |
diff --git a/src/tests/disabled_functions_chain.phpt b/src/tests/disabled_functions_chain.phpt index b25f800..ed680b1 100644 --- a/src/tests/disabled_functions_chain.phpt +++ b/src/tests/disabled_functions_chain.phpt | |||
| @@ -23,6 +23,4 @@ echo "I'm after the call to outer\n"; | |||
| 23 | --EXPECTF-- | 23 | --EXPECTF-- |
| 24 | I'm before the call to outer | 24 | I'm before the call to outer |
| 25 | I'm in the outer function, before the call! | 25 | I'm in the outer function, before the call! |
| 26 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain.php:%d has been disabled. | 26 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain.php:%d has been disabled. \ No newline at end of file |
| 27 | I'm in the outer function, after the call! | ||
| 28 | I'm after the call to outer | ||
diff --git a/src/tests/disabled_functions_chain_call_user_func.phpt b/src/tests/disabled_functions_chain_call_user_func.phpt index e13bd5a..e431930 100644 --- a/src/tests/disabled_functions_chain_call_user_func.phpt +++ b/src/tests/disabled_functions_chain_call_user_func.phpt | |||
| @@ -23,6 +23,4 @@ echo "I'm after the call to outer\n"; | |||
| 23 | --EXPECTF-- | 23 | --EXPECTF-- |
| 24 | I'm before the call to outer | 24 | I'm before the call to outer |
| 25 | I'm in the outer function, before the call! | 25 | I'm in the outer function, before the call! |
| 26 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain_call_user_func.php:%d has been disabled. | 26 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'outer>inner' in %a/disabled_functions_chain_call_user_func.php:%d has been disabled. \ No newline at end of file |
| 27 | I'm in the outer function, after the call! | ||
| 28 | I'm after the call to outer | ||
diff --git a/src/tests/disabled_functions_method.phpt b/src/tests/disabled_functions_method.phpt index 33651b7..f4fba85 100644 --- a/src/tests/disabled_functions_method.phpt +++ b/src/tests/disabled_functions_method.phpt | |||
| @@ -25,5 +25,3 @@ $c->method3("pouet"); | |||
| 25 | ?> | 25 | ?> |
| 26 | --EXPECTF-- | 26 | --EXPECTF-- |
| 27 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'AwesomeClass::method1' in %a/tests/disabled_functions_method.php:4 has been disabled. | 27 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'AwesomeClass::method1' in %a/tests/disabled_functions_method.php:4 has been disabled. |
| 28 | method2:paf | ||
| 29 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'AwesomeClass::method3' in %a/tests/disabled_functions_method.php:10 has been disabled, because its argument 'a' content (pouet) matched a rule. | ||
diff --git a/src/tests/disabled_functions_param_array.phpt b/src/tests/disabled_functions_param_array.phpt index 6596d1a..4738745 100644 --- a/src/tests/disabled_functions_param_array.phpt +++ b/src/tests/disabled_functions_param_array.phpt | |||
| @@ -28,10 +28,4 @@ foo($a); | |||
| 28 | ?> | 28 | ?> |
| 29 | --EXPECTF-- | 29 | --EXPECTF-- |
| 30 | test1 | 30 | test1 |
| 31 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '1'. | 31 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '1'. \ No newline at end of file |
| 32 | abcde | ||
| 33 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '2'. | ||
| 34 | eee | ||
| 35 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '3'. | ||
| 36 | cccc | ||
| 37 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foo' in %a/disabled_functions_param_array.php:3 has been disabled, because its argument 'arr' content (Array) matched the rule '4'. | ||
diff --git a/src/tests/disabled_functions_param_int.phpt b/src/tests/disabled_functions_param_int.phpt index 3b2cc08..0e6a62c 100644 --- a/src/tests/disabled_functions_param_int.phpt +++ b/src/tests/disabled_functions_param_int.phpt | |||
| @@ -19,7 +19,3 @@ foobar("10"); | |||
| 19 | --EXPECTF-- | 19 | --EXPECTF-- |
| 20 | 1 | 20 | 1 |
| 21 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (42) matched a rule. | 21 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (42) matched a rule. |
| 22 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (1337) matched a rule. | ||
| 23 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (13374242) matched a rule. | ||
| 24 | [snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'foobar' in %a/tests/disabled_functions_param_int.php:3 has been disabled, because its argument 'id' content (42) matched a rule. | ||
| 25 | 10 | ||
