diff options
| author | jvoisin | 2018-01-04 15:59:59 +0100 |
|---|---|---|
| committer | GitHub | 2018-01-04 15:59:59 +0100 |
| commit | 3b113be573cdbca20ce9ec9c0a6efb25ccf51db5 (patch) | |
| tree | 5fabbd1da7cd740f26354ffbd2234eba71ffdead /src/sp_harden_rand.c | |
| parent | 84e423300c440e96c34ada2620e0f78f827592e8 (diff) | |
Eval blacklist
Add support for eval filtering, only blacklist for now
Diffstat (limited to 'src/sp_harden_rand.c')
| -rw-r--r-- | src/sp_harden_rand.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sp_harden_rand.c b/src/sp_harden_rand.c index 3727bef..cb57591 100644 --- a/src/sp_harden_rand.c +++ b/src/sp_harden_rand.c | |||
| @@ -56,9 +56,8 @@ PHP_FUNCTION(sp_rand) { | |||
| 56 | 56 | ||
| 57 | /* call the original `rand` function, | 57 | /* call the original `rand` function, |
| 58 | * since we might no be the only ones to hook it*/ | 58 | * since we might no be the only ones to hook it*/ |
| 59 | orig_handler = | 59 | orig_handler = zend_hash_str_find_ptr( |
| 60 | zend_hash_str_find_ptr(SNUFFLEUPAGUS_G(sp_internal_functions_hook), | 60 | SNUFFLEUPAGUS_G(sp_internal_functions_hook), "rand", strlen("rand")); |
| 61 | "rand", strlen("rand")); | ||
| 62 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); | 61 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); |
| 63 | 62 | ||
| 64 | random_int_wrapper(INTERNAL_FUNCTION_PARAM_PASSTHRU); | 63 | random_int_wrapper(INTERNAL_FUNCTION_PARAM_PASSTHRU); |
| @@ -70,8 +69,8 @@ PHP_FUNCTION(sp_mt_rand) { | |||
| 70 | /* call the original `mt_rand` function, | 69 | /* call the original `mt_rand` function, |
| 71 | * since we might no be the only ones to hook it*/ | 70 | * since we might no be the only ones to hook it*/ |
| 72 | orig_handler = | 71 | orig_handler = |
| 73 | zend_hash_str_find_ptr(SNUFFLEUPAGUS_G(sp_internal_functions_hook), | 72 | zend_hash_str_find_ptr(SNUFFLEUPAGUS_G(sp_internal_functions_hook), |
| 74 | "mt_rand", strlen("mt_rand")); | 73 | "mt_rand", strlen("mt_rand")); |
| 75 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); | 74 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); |
| 76 | 75 | ||
| 77 | random_int_wrapper(INTERNAL_FUNCTION_PARAM_PASSTHRU); | 76 | random_int_wrapper(INTERNAL_FUNCTION_PARAM_PASSTHRU); |
