diff options
Diffstat (limited to 'win32/winutil.c')
-rw-r--r-- | win32/winutil.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/win32/winutil.c b/win32/winutil.c index 5203fb4e66..f13a785212 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -79,10 +79,7 @@ void php_win32_free_rng_lock() PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ */ - unsigned int has_contextg = 0; - BOOL ret; - size_t i = 0; #ifdef ZTS tsrm_mutex_lock(php_lock_win32_cryptoctx); @@ -115,7 +112,8 @@ PHPAPI int php_win32_get_random_bytes(unsigned char *buf, size_t size) { /* {{{ return FAILURE; } - ret = CryptGenRandom(hCryptProv, size, buf); + /* XXX should go in the loop if size exceeds UINT_MAX */ + ret = CryptGenRandom(hCryptProv, (DWORD)size, buf); if (ret) { return SUCCESS; |