Compare commits

...
14 Commits
Author SHA1 Message Date
Anatol Belski 734a5fca2c update NEWS 2016-04-28 19:31:12 +02:00
Dmitry Stogov 9e4de0cbdc Added test 2016-04-28 19:24:32 +02:00
Bob Weinand ee2c9065d8 Fixed bug #72116 (7.0.6 array_fill optimization breaks implementation) 2016-04-28 19:24:13 +02:00
Dmitry Stogov 75fa8842f4 Fixed BC break described by bug #72119.
It was introduced after 7.0.5 release by attempt to fix bug #71428.
2016-04-28 19:21:14 +02:00
Stanislav Malyshev 3b8d4de300 Fix bug #71923 - integer overflow in ZipArchive::getFrom* 2016-04-27 17:51:54 +02:00
Anatol Belski 7133f28df5 set versions 2016-04-27 14:47:57 +02:00
Anatol Belski 11bcba38cc update NEWS 2016-04-27 14:45:58 +02:00
Anatol Belski f16bc42465 fix/improve tests 2016-04-27 14:35:23 +02:00
Anatol Belski 66f92ec63b fix merge 2016-04-27 13:37:48 +02:00
Anatol Belski 4c0d91caef Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix memory leak
  Fix bug #72099: xml_parse_into_struct segmentation fault
  5.5.36 now
  Fix bug #72094 - Out of bounds heap read access in exif header processing
  Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition
  Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset
  Fix for bug #71912 (libgd: signedness vulnerability)
  Typo in NEWS
2016-04-27 13:21:30 +02:00
Anatol Belski eaaa1affbc sync with NEWS improvements 2016-04-25 10:04:28 +02:00
Remi Collet 8090c73262 fix skipif 2016-04-12 13:50:01 +02:00
Xinchen Hui de3cc93543 This only make sense on *nix 2016-04-12 10:44:31 +02:00
Anatol Belski 83b22e0f56 set RC1 versions 2016-04-12 07:04:44 +02:00
30 changed files with 313 additions and 60 deletions

No files matched your search

+29 -14
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016 PHP 7.0.6
28 Apr 2016 PHP 7.0.6
- Core:
. Fixed bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1'
@@ -27,26 +27,36 @@ PHP NEWS
. Fixed bug #71980 (Decorated/Nested Generator is Uncloseable in Finally).
(Nikita)
- BCmath:
. Fixed bug #72093 (bcpowmod accepts negative scale and corrupts
_one_ definition). (Stas)
- Curl:
. Fixed bug #71831 (CURLOPT_NOPROXY applied as long instead of string).
(Michael Sierks)
- Date:
. Fixed bug #71889 (DateInterval::format Segmentation fault).
(Thomas Punt)
. Fixed bug #71889 (DateInterval::format Segmentation fault). (Thomas Punt)
- EXIF:
. Fixed bug #72094 (Out of bounds heap read access in exif header processing). (Stas)
- GD:
. Fixed bug #71912 (libgd: signedness vulnerability). (Stas)
- Intl:
. Fixed bug #71516 (IntlDateFormatter looses locale if pattern is set
via constructor). (Anatol)
. Fixed bug #70455 (Missing constant: IntlChar::NO_NUMERIC_VALUE).
(Anatol)
. Fixed bug #70451, #70452 (Inconsistencies in return values of
IntlChar methods). (Daniel Persson)
. Fixed bug #71516 (IntlDateFormatter looses locale if pattern is set via
constructor). (Anatol)
. Fixed bug #70455 (Missing constant: IntlChar::NO_NUMERIC_VALUE). (Anatol)
. Fixed bug #70451, #70452 (Inconsistencies in return values of IntlChar
methods). (Daniel Persson)
. Fixed bug #68893 (Stackoverflow in datefmt_create). (Anatol)
. Fixed bug #66289 (Locale::lookup incorrectly returns en or en_US if locale
is empty). (Anatol)
. Fixed bug #70484 (selectordinal doesn't work with named parameters).
(Anatol)
. Fixed bug #72061 (Out-of-bounds reads in zif_grapheme_stripos with negative
offset). (Stas)
- ODBC:
. Fixed bug #63171 (Script hangs after max_execution_time). (Remi)
@@ -58,14 +68,12 @@ PHP NEWS
- PDO:
. Fixed bug #52098 (Own PDOStatement implementation ignore __call()).
(Daniel kalaspuffar, Julien)
. Fixed bug #71447 (Quotes inside comments not properly handled).
(Matteo)
. Fixed bug #71447 (Quotes inside comments not properly handled). (Matteo)
- PDO_DBlib:
. Fixed bug #71943 (dblib_handle_quoter needs to allocate an extra byte).
(Adam Baratz)
. Add DBLIB-specific attributes for controlling timeouts.
(Adam Baratz)
. Add DBLIB-specific attributes for controlling timeouts. (Adam Baratz)
- PDO_pgsql:
. Fixed bug #62498 (pdo_pgsql inefficient when getColumnMeta() is used).
@@ -105,6 +113,13 @@ PHP NEWS
. Fixed bug #71827 (substr_replace bug, string length). (krakjoe)
. Fixed bug #67512 (php_crypt() crashes if crypt_r() does not exist or
_REENTRANT is not defined). (Nikita)
. Fixed bug #72116 (array_fill optimization breaks implementation). (Bob)
- XML:
. Fixed bug #72099 (xml_parse_into_struct segmentation fault). (Stas)
- Zip:
. Fixed bug #71923 (integer overflow in ZipArchive::getFrom*). (Stas)
31 Mar 2016 PHP 7.0.5
@@ -165,7 +180,7 @@ PHP NEWS
(nish dot aravamudan at canonical dot com)
- PDO_DBlib:
. Bug #54648 (PDO::MSSQL forces format of datetime fields).
. Fixed bug #54648 (PDO::MSSQL forces format of datetime fields).
(steven dot lambeth at gmx dot de, Anatol)
- Phar:
+2
View File
@@ -1,5 +1,7 @@
--TEST--
bug #71428.1: inheritance with null default values
--XFAIL--
This is a BC break
--FILE--
<?php
class A {
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
bug #71428.2: inheritance of ye olde dynamic interfaces
--SKIPIF--
<?php if (!extension_loaded('pdo')) ?>
<?php if (!extension_loaded('pdo')) die("skip PDO is not available"); ?>
--FILE--
<?php
interface StatementInterface {
+2
View File
@@ -1,5 +1,7 @@
--TEST--
bug #71428: Validation type inheritance with = NULL
--XFAIL--
This is a BC break
--FILE--
<?php
class A { }
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #72119 (Interface declaration compatibility regression with default values)
--FILE--
<?php
interface Foo {
public function bar(array $baz = null);
}
class Hello implements Foo {
public function bar(array $baz = [])
{
}
}
echo "OK\n";
?>
--EXPECT--
OK
+3
View File
@@ -319,10 +319,13 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
return 0;
}
#if 0
// This introduces BC break described at https://bugs.php.net/bug.php?id=72119
if (proto_arg_info->type_hint && proto_arg_info->allow_null && !fe_arg_info->allow_null) {
/* incompatible nullability */
return 0;
}
#endif
/* by-ref constraints on arguments are invariant */
if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) {
+1 -1
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=6
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+24 -2
View File
@@ -207,6 +207,21 @@ static void php_str2num(bc_num *num, char *str)
}
/* }}} */
/* {{{ split_bc_num
Convert to bc_num detecting scale */
static bc_num split_bc_num(bc_num num) {
bc_num newnum;
if (num->n_refs >= 1) {
return num;
}
newnum = _bc_new_num_ex(0, 0, 0);
*newnum = *num;
newnum->n_refs = 1;
num->n_refs--;
return newnum;
}
/* }}} */
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
Returns the sum of two arbitrary precision numbers */
PHP_FUNCTION(bcadd)
@@ -233,6 +248,7 @@ PHP_FUNCTION(bcadd)
bc_add (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -270,6 +286,7 @@ PHP_FUNCTION(bcsub)
bc_sub (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -307,6 +324,7 @@ PHP_FUNCTION(bcmul)
bc_multiply (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -345,6 +363,7 @@ PHP_FUNCTION(bcdiv)
switch (bc_divide(first, second, &result, scale)) {
case 0: /* OK */
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
RETVAL_STR(bc_num2str(result));
@@ -420,8 +439,9 @@ PHP_FUNCTION(bcpowmod)
scale_int = (int) ((int)scale < 0 ? 0 : scale);
if (bc_raisemod(first, second, mod, &result, scale_int) != -1) {
if (result->n_scale > scale) {
result->n_scale = (int)scale;
if (result->n_scale > scale_int) {
result = split_bc_num(result);
result->n_scale = scale_int;
}
RETVAL_STR(bc_num2str(result));
} else {
@@ -462,6 +482,7 @@ PHP_FUNCTION(bcpow)
bc_raise (first, second, &result, scale);
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
@@ -496,6 +517,7 @@ PHP_FUNCTION(bcsqrt)
if (bc_sqrt (&result, scale) != 0) {
if (result->n_scale > scale) {
result = split_bc_num(result);
result->n_scale = scale;
}
RETVAL_STR(bc_num2str(result));
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
--SKIPIF--
<?php
if(!extension_loaded("bcmath")) print "skip";
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip valid only for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod(1, "A", 128, -200));
var_dump(bcpowmod(1, 1.2, 1, 1));
?>
--EXPECTF--
string(1) "1"
string(3) "0.0"
bc math warning: non-zero scale in exponent
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
--SKIPIF--
<?php
if(!extension_loaded("bcmath")) print "skip";
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not valid for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod(1, "A", 128, -200));
var_dump(bcpowmod(1, 1.2, 1, 1));
?>
--EXPECTF--
string(1) "1"
bc math warning: non-zero scale in exponent
string(3) "0.0"
+15 -2
View File
@@ -2946,7 +2946,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
/* When there are any characters after the first NUL */
ImageInfo->CopyrightPhotographer = estrdup(value_ptr);
ImageInfo->CopyrightEditor = estrndup(value_ptr+length+1, byte_count-length-1);
spprintf(&ImageInfo->Copyright, 0, "%s, %s", value_ptr, value_ptr+length+1);
spprintf(&ImageInfo->Copyright, 0, "%s, %s", ImageInfo->CopyrightPhotographer, ImageInfo->CopyrightEditor);
/* format = TAG_FMT_UNDEFINED; this musn't be ASCII */
/* but we are not supposed to change this */
/* keep in mind that image_info does not store editor value */
@@ -3115,6 +3115,11 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
ImageInfo->sections_found |= FOUND_IFD0;
if ((dir_start + 2) >= (offset_base+IFDlength)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
return FALSE;
}
NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel);
if ((dir_start+2+NumDirEntries*12) > (offset_base+IFDlength)) {
@@ -3138,6 +3143,10 @@ static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start,
* Hack to make it process IDF1 I hope
* There are 2 IDFs, the second one holds the keys (0x0201 and 0x0202) to the thumbnail
*/
if ((dir_start+2+12*de + 4) >= (offset_base+IFDlength)) {
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size");
return FALSE;
}
NextDirOffset = php_ifd_get32u(dir_start+2+12*de, ImageInfo->motorola_intel);
if (NextDirOffset) {
/* the next line seems false but here IFDlength means length of all IFDs */
@@ -3187,9 +3196,13 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
}
/* Check the next two values for correctness. */
if (length < 8) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF start (1)");
return;
}
exif_value_2a = php_ifd_get16u(CharBuf+2, ImageInfo->motorola_intel);
offset_of_ifd = php_ifd_get32u(CharBuf+4, ImageInfo->motorola_intel);
if ( exif_value_2a != 0x2a || offset_of_ifd < 0x08) {
if (exif_value_2a != 0x2a || offset_of_ifd < 0x08) {
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Invalid TIFF start (1)");
return;
}
+61
View File
@@ -0,0 +1,61 @@
--TEST--
Bug #72094: Out of bounds heap read access in exif header processing
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
print_r(exif_read_data(__DIR__ . '/bug72094_1.jpg'));
print_r(exif_read_data(__DIR__ . '/bug72094_2.jpg'));
print_r(exif_read_data(__DIR__ . '/bug72094_3.jpg'));
print_r(exif_read_data(__DIR__ . '/bug72094_4.jpg'));
?>
DONE
--EXPECTF--
Warning: exif_read_data(bug72094_1.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): Process tag(x8298=Copyright ): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): Illegal IFD offset in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): File structure corrupted in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_1.jpg): Invalid JPEG file in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_2.jpg): Illegal IFD size in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_2.jpg): File structure corrupted in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_2.jpg): Invalid JPEG file in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Illegal IFD size in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): File structure corrupted in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_3.jpg): Invalid JPEG file in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_4.jpg): Invalid TIFF start (1) in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_4.jpg): File structure corrupted in %s%ebug72094.php on line %d
Warning: exif_read_data(bug72094_4.jpg): Invalid JPEG file in %s%ebug72094.php on line %d
DONE
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6
View File
@@ -145,9 +145,15 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
cidx = gdCalloc(sidx, 1);
for (i = 0; i < nc; i++) {
if (gdGetInt(&cidx[i].offset, in) != 1) {
gdFree(cidx);
goto fail1;
}
if (gdGetInt(&cidx[i].size, in) != 1) {
gdFree(cidx);
goto fail1;
}
if (cidx[i].offset < 0 || cidx[i].size < 0) {
gdFree(cidx);
goto fail1;
}
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #71912 (libgd: signedness vulnerability)
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imagecreatefromgd2')) die('skip imagecreatefromgd2() not available');
?>
--FILE--
<?php
imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . "invalid_neg_size.gd2");
?>
OK
--EXPECTF--
Warning: imagecreatefromgd2(): '%s%einvalid_neg_size.gd2' is not a valid GD2 file in %s%ebug71912.php on line %d
OK
Binary file not shown.
+5 -3
View File
@@ -110,7 +110,7 @@ PHP_FUNCTION(grapheme_strpos)
size_t haystack_len, needle_len;
const char *found;
zend_long loffset = 0;
int32_t offset = 0;
int32_t offset = 0, noffset = 0;
zend_long ret_pos;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) {
@@ -126,6 +126,7 @@ PHP_FUNCTION(grapheme_strpos)
/* we checked that it will fit: */
offset = (int32_t) loffset;
noffset = offset >= 0 ? offset : haystack_len + offset;
/* the offset is 'grapheme count offset' so it still might be invalid - we'll check it later */
@@ -138,7 +139,7 @@ PHP_FUNCTION(grapheme_strpos)
/* quick check to see if the string might be there
* I realize that 'offset' is 'grapheme count offset' but will work in spite of that
*/
found = php_memnstr(haystack + offset, needle, needle_len, haystack + haystack_len);
found = php_memnstr(haystack + noffset, needle, needle_len, haystack + haystack_len);
/* if it isn't there the we are done */
if (!found) {
@@ -199,12 +200,13 @@ PHP_FUNCTION(grapheme_stripos)
is_ascii = ( grapheme_ascii_check((unsigned char*)haystack, haystack_len) >= 0 );
if ( is_ascii ) {
int32_t noffset = offset >= 0 ? offset : haystack_len + offset;
needle_dup = estrndup(needle, needle_len);
php_strtolower(needle_dup, needle_len);
haystack_dup = estrndup(haystack, haystack_len);
php_strtolower(haystack_dup, haystack_len);
found = php_memnstr(haystack_dup + offset, needle_dup, needle_len, haystack_dup + haystack_len);
found = php_memnstr(haystack_dup + noffset, needle_dup, needle_len, haystack_dup + haystack_len);
efree(haystack_dup);
efree(needle_dup);
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #72061: Out-of-bounds reads in zif_grapheme_stripos with negative offset
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
var_dump(grapheme_stripos(str_repeat("ABCD", 16384), "A", -201));
var_dump(grapheme_strpos(str_repeat("ABCD", 16384), "A", -201));
?>
DONE
--EXPECT--
int(65336)
int(65336)
DONE
+1 -1
View File
@@ -215,4 +215,4 @@ opcache.mmap_base
errors.
opcache.lockfile_path (default "/tmp")
Absolute path used to store shared lockfiles.
Absolute path used to store shared lockfiles (for *nix only)
+2
View File
@@ -217,7 +217,9 @@ typedef struct _zend_accel_directives {
zend_long max_file_size;
zend_long interned_strings_buffer;
char *restrict_api;
#ifndef ZEND_WIN32
char *lockfile_path;
#endif
#ifdef HAVE_OPCACHE_FILE_CACHE
char *file_cache;
zend_bool file_cache_only;
+6 -2
View File
@@ -298,9 +298,10 @@ ZEND_INI_BEGIN()
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.error_log" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.error_log, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.restrict_api" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.restrict_api, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.lockfile_path" , "/tmp" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.lockfile_path, zend_accel_globals, accel_globals)
#ifdef ZEND_WIN32
#ifndef ZEND_WIN32
STD_PHP_INI_ENTRY("opcache.lockfile_path" , "/tmp" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.lockfile_path, zend_accel_globals, accel_globals)
#else
STD_PHP_INI_ENTRY("opcache.mmap_base", NULL, PHP_INI_SYSTEM, OnUpdateString, accel_directives.mmap_base, zend_accel_globals, accel_globals)
#endif
@@ -711,7 +712,10 @@ static ZEND_FUNCTION(opcache_get_configuration)
add_assoc_bool(&directives, "opcache.fast_shutdown", ZCG(accel_directives).fast_shutdown);
add_assoc_bool(&directives, "opcache.enable_file_override", ZCG(accel_directives).file_override_enabled);
add_assoc_long(&directives, "opcache.optimization_level", ZCG(accel_directives).optimization_level);
#ifndef ZEND_WIN32
add_assoc_string(&directives, "opcache.lockfile_path", STRING_NOT_NULL(ZCG(accel_directives).lockfile_path));
#endif
#ifdef HAVE_OPCACHE_FILE_CACHE
add_assoc_string(&directives, "opcache.file_cache", ZCG(accel_directives).file_cache ? ZCG(accel_directives).file_cache : "");
+1
View File
@@ -2029,6 +2029,7 @@ PHP_FUNCTION(array_fill)
Z_ARRVAL_P(return_value)->nNumUsed = start_key + num;
Z_ARRVAL_P(return_value)->nNumOfElements = num;
Z_ARRVAL_P(return_value)->nInternalPointer = start_key;
Z_ARRVAL_P(return_value)->nNextFreeElement = start_key + num;
if (Z_REFCOUNTED_P(val)) {
GC_REFCOUNT(Z_COUNTED_P(val)) += num;
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #72116 (insertion after array_fill fails)
--FILE--
<?php
$x = array_fill(0, 1, '..');
$x[] = 'a';
var_dump($x);
?>
--EXPECT--
array(2) {
[0]=>
string(2) ".."
[1]=>
string(1) "a"
}
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #72099: xml_parse_into_struct segmentation fault
--SKIPIF--
<?php
require_once("skipif.inc");
?>
--FILE--
<?php
$var1=xml_parser_create_ns();
$var2=str_repeat("a", 10);
$var3=[];
$var4=[];
xml_parse_into_struct($var1, $var2, $var3, $var4);
var_dump($var3);
--EXPECT--
array(0) {
}
+30 -30
View File
@@ -286,7 +286,7 @@ xml_encoding xml_encodings[] = {
static XML_Memory_Handling_Suite php_xml_mem_hdlrs;
/* True globals, no need for thread safety */
static int le_xml_parser;
static int le_xml_parser;
/* }}} */
@@ -349,7 +349,7 @@ PHP_MINIT_FUNCTION(xml)
REGISTER_LONG_CONSTANT("XML_OPTION_SKIP_WHITE", PHP_XML_OPTION_SKIP_WHITE, CONST_CS|CONST_PERSISTENT);
/* this object should not be pre-initialised at compile time,
as the order of members may vary */
as the order of members may vary */
php_xml_mem_hdlrs.malloc_fcn = php_xml_malloc_wrapper;
php_xml_mem_hdlrs.realloc_fcn = php_xml_realloc_wrapper;
@@ -397,7 +397,7 @@ static void _xml_xmlchar_zval(const XML_Char *s, int len, const XML_Char *encodi
static void xml_parser_dtor(zend_resource *rsrc)
{
xml_parser *parser = (xml_parser *)rsrc->ptr;
if (parser->parser) {
XML_ParserFree(parser->parser);
}
@@ -899,7 +899,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
} else {
add_assoc_str(parser->ctag, "value", decoded_value);
}
} else {
zval tag;
zval *curtag, *mytype, *myval;
@@ -920,7 +920,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
break;
} ZEND_HASH_FOREACH_END();
if (parser->level <= XML_MAXLEVEL) {
if (parser->level <= XML_MAXLEVEL && parser->level > 0) {
array_init(&tag);
_xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset);
@@ -977,8 +977,8 @@ void _xml_defaultHandler(void *userData, const XML_Char *s, int len)
/* }}} */
/* {{{ _xml_unparsedEntityDeclHandler() */
void _xml_unparsedEntityDeclHandler(void *userData,
const XML_Char *entityName,
void _xml_unparsedEntityDeclHandler(void *userData,
const XML_Char *entityName,
const XML_Char *base,
const XML_Char *systemId,
const XML_Char *publicId,
@@ -1146,15 +1146,15 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
}
/* }}} */
/* {{{ proto resource xml_parser_create([string encoding])
/* {{{ proto resource xml_parser_create([string encoding])
Create an XML parser */
PHP_FUNCTION(xml_parser_create)
{
php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]])
/* {{{ proto resource xml_parser_create_ns([string encoding [, string sep]])
Create an XML parser */
PHP_FUNCTION(xml_parser_create_ns)
{
@@ -1162,7 +1162,7 @@ PHP_FUNCTION(xml_parser_create_ns)
}
/* }}} */
/* {{{ proto int xml_set_object(resource parser, object &obj)
/* {{{ proto int xml_set_object(resource parser, object &obj)
Set up object which should be used for callbacks */
PHP_FUNCTION(xml_set_object)
{
@@ -1184,7 +1184,7 @@ PHP_FUNCTION(xml_set_object)
/* please leave this commented - or ask thies@thieso.net before doing it (again) */
/* #ifdef ZEND_ENGINE_2
zval_add_ref(&parser->object);
zval_add_ref(&parser->object);
#endif */
ZVAL_COPY(&parser->object, mythis);
@@ -1193,7 +1193,7 @@ PHP_FUNCTION(xml_set_object)
}
/* }}} */
/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl)
/* {{{ proto int xml_set_element_handler(resource parser, string shdl, string ehdl)
Set up start and end element handlers */
PHP_FUNCTION(xml_set_element_handler)
{
@@ -1215,7 +1215,7 @@ PHP_FUNCTION(xml_set_element_handler)
}
/* }}} */
/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl)
/* {{{ proto int xml_set_character_data_handler(resource parser, string hdl)
Set up character data handler */
PHP_FUNCTION(xml_set_character_data_handler)
{
@@ -1236,7 +1236,7 @@ PHP_FUNCTION(xml_set_character_data_handler)
}
/* }}} */
/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl)
/* {{{ proto int xml_set_processing_instruction_handler(resource parser, string hdl)
Set up processing instruction (PI) handler */
PHP_FUNCTION(xml_set_processing_instruction_handler)
{
@@ -1257,7 +1257,7 @@ PHP_FUNCTION(xml_set_processing_instruction_handler)
}
/* }}} */
/* {{{ proto int xml_set_default_handler(resource parser, string hdl)
/* {{{ proto int xml_set_default_handler(resource parser, string hdl)
Set up default handler */
PHP_FUNCTION(xml_set_default_handler)
{
@@ -1278,7 +1278,7 @@ PHP_FUNCTION(xml_set_default_handler)
}
/* }}} */
/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl)
/* {{{ proto int xml_set_unparsed_entity_decl_handler(resource parser, string hdl)
Set up unparsed entity declaration handler */
PHP_FUNCTION(xml_set_unparsed_entity_decl_handler)
{
@@ -1299,7 +1299,7 @@ PHP_FUNCTION(xml_set_unparsed_entity_decl_handler)
}
/* }}} */
/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl)
/* {{{ proto int xml_set_notation_decl_handler(resource parser, string hdl)
Set up notation declaration handler */
PHP_FUNCTION(xml_set_notation_decl_handler)
{
@@ -1320,7 +1320,7 @@ PHP_FUNCTION(xml_set_notation_decl_handler)
}
/* }}} */
/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl)
/* {{{ proto int xml_set_external_entity_ref_handler(resource parser, string hdl)
Set up external entity reference handler */
PHP_FUNCTION(xml_set_external_entity_ref_handler)
{
@@ -1341,7 +1341,7 @@ PHP_FUNCTION(xml_set_external_entity_ref_handler)
}
/* }}} */
/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl)
/* {{{ proto int xml_set_start_namespace_decl_handler(resource parser, string hdl)
Set up character data handler */
PHP_FUNCTION(xml_set_start_namespace_decl_handler)
{
@@ -1362,7 +1362,7 @@ PHP_FUNCTION(xml_set_start_namespace_decl_handler)
}
/* }}} */
/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl)
/* {{{ proto int xml_set_end_namespace_decl_handler(resource parser, string hdl)
Set up character data handler */
PHP_FUNCTION(xml_set_end_namespace_decl_handler)
{
@@ -1442,7 +1442,7 @@ PHP_FUNCTION(xml_parse_into_struct)
if (info) {
ZVAL_COPY_VALUE(&parser->info, info);
}
parser->level = 0;
parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0);
@@ -1458,7 +1458,7 @@ PHP_FUNCTION(xml_parse_into_struct)
}
/* }}} */
/* {{{ proto int xml_get_error_code(resource parser)
/* {{{ proto int xml_get_error_code(resource parser)
Get XML parser error code */
PHP_FUNCTION(xml_get_error_code)
{
@@ -1495,7 +1495,7 @@ PHP_FUNCTION(xml_error_string)
}
/* }}} */
/* {{{ proto int xml_get_current_line_number(resource parser)
/* {{{ proto int xml_get_current_line_number(resource parser)
Get current line number for an XML parser */
PHP_FUNCTION(xml_get_current_line_number)
{
@@ -1533,7 +1533,7 @@ PHP_FUNCTION(xml_get_current_column_number)
}
/* }}} */
/* {{{ proto int xml_get_current_byte_index(resource parser)
/* {{{ proto int xml_get_current_byte_index(resource parser)
Get current byte index for an XML parser */
PHP_FUNCTION(xml_get_current_byte_index)
{
@@ -1552,7 +1552,7 @@ PHP_FUNCTION(xml_get_current_byte_index)
}
/* }}} */
/* {{{ proto int xml_parser_free(resource parser)
/* {{{ proto int xml_parser_free(resource parser)
Free an XML parser */
PHP_FUNCTION(xml_parser_free)
{
@@ -1580,7 +1580,7 @@ PHP_FUNCTION(xml_parser_free)
}
/* }}} */
/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value)
/* {{{ proto int xml_parser_set_option(resource parser, int option, mixed value)
Set options in an XML parser */
PHP_FUNCTION(xml_parser_set_option)
{
@@ -1629,7 +1629,7 @@ PHP_FUNCTION(xml_parser_set_option)
}
/* }}} */
/* {{{ proto int xml_parser_get_option(resource parser, int option)
/* {{{ proto int xml_parser_get_option(resource parser, int option)
Get options from an XML parser */
PHP_FUNCTION(xml_parser_get_option)
{
@@ -1662,7 +1662,7 @@ PHP_FUNCTION(xml_parser_get_option)
}
/* }}} */
/* {{{ proto string utf8_encode(string data)
/* {{{ proto string utf8_encode(string data)
Encodes an ISO-8859-1 string to UTF-8 */
PHP_FUNCTION(utf8_encode)
{
@@ -1682,7 +1682,7 @@ PHP_FUNCTION(utf8_encode)
}
/* }}} */
/* {{{ proto string utf8_decode(string data)
/* {{{ proto string utf8_decode(string data)
Converts a UTF-8 encoded string to ISO-8859-1 */
PHP_FUNCTION(utf8_decode)
{
+2 -2
View File
@@ -1281,7 +1281,7 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_read)
}
if (zr_rsrc->zf) {
buffer = zend_string_alloc(len, 0);
buffer = zend_string_safe_alloc(1, len, 0, 0);
n = zip_fread(zr_rsrc->zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer));
if (n > 0) {
ZSTR_VAL(buffer)[n] = '\0';
@@ -2728,7 +2728,7 @@ static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
RETURN_FALSE;
}
buffer = zend_string_alloc(len, 0);
buffer = zend_string_safe_alloc(1, len, 0, 0);
n = zip_fread(zf, ZSTR_VAL(buffer), ZSTR_LEN(buffer));
if (n < 1) {
zend_string_free(buffer);
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 0
#define PHP_RELEASE_VERSION 6
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.0.6-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.0.6"
#define PHP_VERSION_ID 70006