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:
Yasuo Ohgaki 2013-08-11 06:43:37 +09:00
commit 2df95b1354

View File

@ -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: