You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Discard numbers over the limit to avoid modulo bias */
125
123
while (UNEXPECTED(result>limit)) {
126
124
/* If the requirements cannot be met in a cycles, return fail */
127
-
if (++count>RANDOM_RANGE_ATTEMPTS) {
128
-
zend_throw_error(random_ce_Random_BrokenRandomEngineError, "Failed to generate an acceptable random number in %d attempts", RANDOM_RANGE_ATTEMPTS);
125
+
if (++count>PHP_RANDOM_RANGE_ATTEMPTS) {
126
+
zend_throw_error(random_ce_Random_BrokenRandomEngineError, "Failed to generate an acceptable random number in %d attempts", PHP_RANDOM_RANGE_ATTEMPTS);
/* Discard numbers over the limit to avoid modulo bias */
181
179
while (UNEXPECTED(result>limit)) {
182
180
/* If the requirements cannot be met in a cycles, return fail */
183
-
if (++count>RANDOM_RANGE_ATTEMPTS) {
184
-
zend_throw_error(random_ce_Random_BrokenRandomEngineError, "Failed to generate an acceptable random number in %d attempts", RANDOM_RANGE_ATTEMPTS);
181
+
if (++count>PHP_RANDOM_RANGE_ATTEMPTS) {
182
+
zend_throw_error(random_ce_Random_BrokenRandomEngineError, "Failed to generate an acceptable random number in %d attempts", PHP_RANDOM_RANGE_ATTEMPTS);
for (size_ti=0; i<randomizer->status->last_generated_size; i++) {
330
+
uint64_toffset= (result >> (i*8)) &mask;
331
+
332
+
if (offset >= source_length) {
333
+
if (++failures>PHP_RANDOM_RANGE_ATTEMPTS) {
334
+
zend_string_free(retval);
335
+
zend_throw_error(random_ce_Random_BrokenRandomEngineError, "Failed to generate an acceptable random number in %d attempts", PHP_RANDOM_RANGE_ATTEMPTS);
0 commit comments