summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sp_harden_rand.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sp_harden_rand.c b/src/sp_harden_rand.c
index 2155e7e..812686e 100644
--- a/src/sp_harden_rand.c
+++ b/src/sp_harden_rand.c
@@ -18,7 +18,12 @@ static void random_int_wrapper(INTERNAL_FUNCTION_PARAMETERS) {
18 // LCOV_EXCL_BR_START 18 // LCOV_EXCL_BR_START
19 ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 1, 1); 19 ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 1, 1);
20 Z_PARAM_LONG(min); 20 Z_PARAM_LONG(min);
21 ZEND_PARSE_PARAMETERS_END(); 21 /* ZEND_PARSE_PARAMETERS_END call ZEND_PARSE_PARAMETERS_END_EX with
22 * `return` as a callback. As we don't need to strictly parse all parameters,
23 * we call ZEMD_PARSE_PARAMETERS_END_EX with (void)0 as a callback.
24 * If things go wrong, `php_random_int_throw` will scream anyway.
25 * There might be a better way to do it, please tell us if you know. */
26 ZEND_PARSE_PARAMETERS_END_EX((void)0);
22 // LCOV_EXCL_BR_END 27 // LCOV_EXCL_BR_END
23 max = PHP_MT_RAND_MAX; 28 max = PHP_MT_RAND_MAX;
24 break; 29 break;
@@ -27,7 +32,7 @@ static void random_int_wrapper(INTERNAL_FUNCTION_PARAMETERS) {
27 ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 0, 2); 32 ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 0, 2);
28 Z_PARAM_LONG(min); 33 Z_PARAM_LONG(min);
29 Z_PARAM_LONG(max); 34 Z_PARAM_LONG(max);
30 ZEND_PARSE_PARAMETERS_END(); 35 ZEND_PARSE_PARAMETERS_END_EX((void)0);
31 } 36 }
32 37
33 if (min > max) { 38 if (min > max) {