mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
- Fix bug #55622, better fix for this issue, old fix can break if sizeof(size_t) > sizeof(int) like on sparc
This commit is contained in:
parent
a7410ea03d
commit
3e0e2820b8
@ -6022,7 +6022,7 @@ PHP_FUNCTION(parse_ini_file)
|
||||
PHP_FUNCTION(parse_ini_string)
|
||||
{
|
||||
char *string = NULL, *str = NULL;
|
||||
size_t str_len = 0;
|
||||
int str_len = 0;
|
||||
zend_bool process_sections = 0;
|
||||
long scanner_mode = ZEND_INI_SCANNER_NORMAL;
|
||||
zend_ini_parser_cb_t ini_parser_cb;
|
||||
@ -6031,6 +6031,10 @@ PHP_FUNCTION(parse_ini_string)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
|
||||
/* Set callback function */
|
||||
if (process_sections) {
|
||||
BG(active_ini_file_section) = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user