svn: /php/php-src/trunk/ext/standard/ basic_functions.c
| From: | Pierre Joye | Date: | Mon, 26 Sep 2011 08:38:03 +0000 |
| Subject: | svn: /php/php-src/trunk/ext/standard/ basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-66653@lists.php.net to get a copy of this message | ||
pajoye Mon, 26 Sep 2011 08:38:03 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=317305
Log:
- Fix bug #55622, better fix for this issue, old fix can break if sizeof(size_t) > sizeof(int)
like on sparc
Bug: https://bugs.php.net/55622 (error getting bug
information)
Changed paths:
U php/php-src/trunk/ext/standard/basic_functions.c
Modified: php/php-src/trunk/ext/standard/basic_functions.c
===================================================================
--- php/php-src/trunk/ext/standard/basic_functions.c 2011-09-26 08:36:33 UTC (rev 317304)
+++ php/php-src/trunk/ext/standard/basic_functions.c 2011-09-26 08:38:03 UTC (rev 317305)
@@ -5965,7 +5965,7 @@
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;
@@ -5974,6 +5974,10 @@
RETURN_FALSE;
}
+ if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
+ RETVAL_FALSE;
+ }
+
/* Set callback function */
if (process_sections) {
BG(active_ini_file_section) = NULL;