mirror of
https://github.com/php/php-src.git
synced 2025-01-16 08:44:09 +08:00
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Fixed possible buffer overflow under Windows. Note: Not a security fix.
This commit is contained in:
commit
2df95b1354
@ -346,7 +346,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
|
||||
unsigned char rbuf[2048];
|
||||
size_t toread = PS(entropy_length);
|
||||
|
||||
if (php_win32_get_random_bytes(rbuf, (size_t) toread) == SUCCESS){
|
||||
if (php_win32_get_random_bytes(rbuf, MIN(toread, sizeof(rbuf))) == SUCCESS){
|
||||
|
||||
switch (PS(hash_func)) {
|
||||
case PS_HASH_FUNC_MD5:
|
||||
|
Loading…
Reference in New Issue
Block a user