mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
parent
908f67b1d4
commit
c0ce2281bc
@ -102,7 +102,6 @@ PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw)
|
||||
|
||||
/* Keep reading until we get enough entropy */
|
||||
do {
|
||||
amount_to_read = size - read_bytes;
|
||||
/* Below, (bytes + read_bytes) is pointer arithmetic.
|
||||
|
||||
bytes read_bytes size
|
||||
@ -112,6 +111,7 @@ PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw)
|
||||
amount_to_read
|
||||
|
||||
*/
|
||||
amount_to_read = size - read_bytes;
|
||||
n = syscall(SYS_getrandom, bytes + read_bytes, amount_to_read, 0);
|
||||
|
||||
if (n == -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user