Skip to content

Commit 0d27b3e

Browse files
committed
Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:php-src: (129 commits) NEWS cleanup NEWS removing the NEWS entry as we had to revert this fix for now Revert "Merge branch 'PHP-5.5' into PHP-5.6" Revert "fix TS build" Revert "Merge branch 'PHP-5.4' into PHP-5.5" Revert "Bug #67965: Fix blocking behavior in non-blocking crypto streams" Revert "Bug #41631: Fix regression from first attempt (6569db8)" NEWS Fixed Bug #65171 imagescale() fails Fixed bug #68234 Revert "Bug #41631: Observe socket read timeouts in SSL streams" PHP-5.6.3 is next update NEWS, 5.6.2 will be a security-only release Fix return code (merges are hard :( ) Fix bug #68113 (Heap corruption in exif_thumbnail()) Fix bug #68089 - do not accept options with embedded \0 Fixed bug #68044: Integer overflow in unserialize() (32-bits only) Fix bug #68027 - fix date parsing in XMLRPC lib Fix bug #68113 (Heap corruption in exif_thumbnail()) ...
2 parents 03797a7 + a3beb42 commit 0d27b3e

File tree

101 files changed

+2940
-1302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2940
-1302
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*.tgz
2020
*.tar.gz
2121
*.tar.bz2
22+
*.tar.xz
2223
.FBCIndex
2324
.FBCLockFolder
2425
.deps

EXTENSIONS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ MAINTENANCE: Maintained
385385
STATUS: Working
386386
SINCE: 4.0.4
387387
-------------------------------------------------------------------------------
388+
EXTENSION: hash
389+
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
390+
MAINTENANCE: Maintained
391+
STATUS: Working
392+
SINCE: 5.1.2
393+
-------------------------------------------------------------------------------
388394
EXTENSION: iconv
389395
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
390396
MAINTENANCE: Maintained
@@ -438,6 +444,12 @@ PRIMARY MAINTAINER: Frank M. Kromann
438444
MAINTENANCE: Unknown
439445
STATUS: Experimental
440446
-------------------------------------------------------------------------------
447+
EXTENSION: opcache
448+
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
449+
MAINTENANCE: Maintained
450+
STATUS: Working
451+
SINCE: 5.5.0
452+
-------------------------------------------------------------------------------
441453
EXTENSION: openssl
442454
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
443455
MAINTENANCE: Maintained

NEWS

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,71 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
?? ??? 2014, PHP 5.6.3
34

4-
?? ??? 2014, PHP 5.6.1
5+
- Core:
6+
. Fixed bug #67739 (Windows 8.1/Server 2012 R2 OS build number reported
7+
as 6.2 (instead of 6.3)). (Christian Wenz)
8+
. Fixed bug #67633 (A foreach on an array returned from a function not doing
9+
copy-on-write). (Nikita)
10+
. Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol)
11+
. Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita)
12+
. Fixed bug #68129 (parse_url() - incomplete support for empty usernames
13+
and passwords) (Tjerk)
14+
. Fixed bug #67949 (DOMNodeList elements should be accessible through
15+
array notation) (Florian)
16+
. Implemented 64-bit format codes for pack() and unpack(). (Leigh)
17+
18+
- Fileinfo:
19+
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
20+
21+
- FPM:
22+
. Fixed bug #65641 (PHP-FPM incorrectly defines the SCRIPT_NAME variable
23+
when using Apache, mod_proxy-fcgi and ProxyPass). (Remi)
24+
. Implemented FR #55508 (listen and listen.allowed_clients should take IPv6
25+
addresses). (Robin Gloster)
26+
27+
- GD:
28+
. Fixed bug #65171 (imagescale() fails without height param). (Remi)
29+
30+
- GMP:
31+
. Implemented gmp_random_range() and gmp_random_bits(). (Leigh)
32+
33+
- Reflection:
34+
. Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi)
35+
36+
- OpenSSL:
37+
. Fixed bug #68074 (Allow to use system cipher list instead of hardcoded
38+
value). (Remi)
39+
40+
- Mysqli:
41+
. Fixed bug #68114 (linker error on some OS X machines with fixed width
42+
decimal support) (Keyur Govande)
43+
44+
- ODBC:
45+
. Fixed bug #68087 (ODBC not correctly reading DATE column when preceded by
46+
a VARCHAR column) (Keyur Govande)
47+
48+
- SPL:
49+
. Fixed bug #68128 (Regression in RecursiveRegexIterator) (Tjerk)
50+
51+
16 Oct 2014, PHP 5.6.2
52+
53+
- Core:
54+
. Fixed bug #68044 (Integer overflow in unserialize() (32-bits only)).
55+
(CVE-2014-3669) (Stas)
56+
57+
- cURL:
58+
. Fixed bug #68089 (NULL byte injection - cURL lib). (Stas)
59+
60+
- EXIF:
61+
. Fixed bug #68113 (Heap corruption in exif_thumbnail()). (CVE-2014-3670)
62+
(Stas)
63+
64+
- XMLRPC:
65+
. Fixed bug #68027 (Global buffer overflow in mkgmtime() function).
66+
(CVE-2014-3668) (Stas)
67+
68+
02 Oct 2014, PHP 5.6.1
569

670
- Core:
771
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
@@ -10,6 +74,13 @@ PHP NEWS
1074
. Fixed bug #67878 (program_prefix not honoured in man pages). (Remi)
1175
. Fixed bug #67938 (Segfault when extending interface method with variadic).
1276
(Nikita)
77+
. Fixed bug #67985 (Incorrect last used array index copied to new array after
78+
unset). (Tjerk)
79+
. Fixed bug #68088 (New Posthandler Potential Illegal efree() vulnerability).
80+
(Mike) (CVE-2014-3622)
81+
82+
- DOM:
83+
. Made DOMNode::textContent writeable. (Tjerk)
1384

1485
- Fileinfo:
1586
. Fixed bug #67731 (finfo::file() returns invalid mime type
@@ -32,12 +103,19 @@ PHP NEWS
32103
. Fixed bug #67850 (extension won't build if openssl compiled without SSLv3).
33104
(Daniel Lowrey)
34105

35-
- DOM:
36-
. Made DOMNode::textContent writeable. (Tjerk)
106+
- phpdbg:
107+
. Fixed issue krakjoe/phpdbg#111 (compile error without ZEND_SIGNALS). (Bob)
37108

38109
- SOAP:
39110
. Fixed bug #67955 (SoapClient prepends 0-byte to cookie names). (Philip Hofstetter)
40111

112+
- Session:
113+
. Fixed bug #67972 (SessionHandler Invalid memory read create_sid()). (Adam)
114+
115+
- Sysvsem:
116+
. Implemented FR #67990 (Add optional nowait argument to sem_acquire).
117+
(Matteo)
118+
41119
28 Aug 2014, PHP 5.6.0
42120

43121
- Apache2 Handler SAPI:
@@ -63,6 +141,7 @@ PHP NEWS
63141
. Fixed bug #66431 (Special Character via COM Interface (CP_UTF8)). (Anatol)
64142

65143
- Core:
144+
. Improved phpinfo() stylesheets. (Colin Viebrock)
66145
. Fixed bug #67693 (incorrect push to the empty array). (Tjerk)
67146
. Removed inconsistency regarding behaviour of array in constants at
68147
run-time. (Bob)

UPGRADING

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ PHP 5.6 UPGRADE NOTES
217217

218218
- Strings:
219219
substr_compare() now allows $length to be zero.
220+
pack() and unpack() now support 64-bit format specifiers: q, Q, J and P.
220221

221222
- Crypt:
222223
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
@@ -269,6 +270,7 @@ PHP 5.6 UPGRADE NOTES
269270
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
270271
Added gmp_import($data, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
271272
Added gmp_export($gmpnumber, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
273+
Added gmp_random_range() and gmp_random_bits() in PHP 5.6.3.
272274

273275
- Hash
274276
Added hash_equals($known_string, $user_string)

Zend/tests/bug67633.phpt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--TEST--
2+
Bug #67633: A foreach on an array returned from a function not doing copy-on-write
3+
--FILE--
4+
<?php
5+
6+
function id($x) {
7+
return $x;
8+
}
9+
10+
function &ref_id(&$x) {
11+
return $x;
12+
}
13+
14+
$c = 'c';
15+
$array = ['a', 'b', $c];
16+
17+
foreach(id($array) as &$v) {
18+
$v .= 'q';
19+
}
20+
var_dump($array);
21+
22+
foreach(ref_id($array) as &$v) {
23+
$v .= 'q';
24+
}
25+
var_dump($array);
26+
27+
?>
28+
--EXPECT--
29+
array(3) {
30+
[0]=>
31+
string(1) "a"
32+
[1]=>
33+
string(1) "b"
34+
[2]=>
35+
string(1) "c"
36+
}
37+
array(3) {
38+
[0]=>
39+
string(2) "aq"
40+
[1]=>
41+
string(2) "bq"
42+
[2]=>
43+
&string(2) "cq"
44+
}

Zend/tests/bug67985.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #67985 - Last used array index not copied to new array at assignment
3+
--FILE--
4+
<?php
5+
6+
$a = ['zero', 'one', 'two'];
7+
unset($a[2]);
8+
$b = $a;
9+
$a[] = 'three';
10+
$b[] = 'three';
11+
12+
var_dump($a === $b);
13+
14+
?>
15+
--EXPECT--
16+
bool(true)

Zend/tests/bug68118.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
3+
--FILE--
4+
<?php
5+
6+
set_error_handler(function() {
7+
$obj = new stdClass;
8+
$obj->test = 'meow';
9+
return true;
10+
});
11+
12+
$a = new stdClass;
13+
$a->undefined .= 'test';
14+
var_dump($a);
15+
16+
?>
17+
--EXPECT--
18+
object(stdClass)#2 (1) {
19+
["undefined"]=>
20+
string(4) "test"
21+
}

Zend/zend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
901901
/* }}} */
902902
END_EXTERN_C()
903903

904-
void zend_append_version_info(const zend_extension *extension) /* {{{ */
904+
ZEND_API void zend_append_version_info(const zend_extension *extension) /* {{{ */
905905
{
906906
char *new_info;
907907
uint new_info_length;

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@ ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
24992499
/* }}} */
25002500

25012501
/* return the next free module number */
2502-
int zend_next_free_module(void) /* {{{ */
2502+
ZEND_API int zend_next_free_module(void) /* {{{ */
25032503
{
25042504
return zend_hash_num_elements(&module_registry) + 1;
25052505
}

Zend/zend_API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ typedef struct _zend_fcall_info_cache {
233233

234234
#define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0)
235235

236-
int zend_next_free_module(void);
236+
ZEND_API int zend_next_free_module(void);
237237

238238
BEGIN_EXTERN_C()
239239
ZEND_API int zend_get_parameters(int ht, int param_count, ...);

Zend/zend_compile.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6337,6 +6337,15 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
63376337
/* save the location of FETCH_W instruction(s) */
63386338
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
63396339
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
6340+
6341+
if (zend_is_function_or_method_call(array)) {
6342+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
6343+
opline->opcode = ZEND_SEPARATE;
6344+
SET_NODE(opline->op1, array);
6345+
SET_UNUSED(opline->op2);
6346+
opline->result_type = IS_VAR;
6347+
opline->result.var = opline->op1.var;
6348+
}
63406349
} else {
63416350
is_variable = 0;
63426351
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));

Zend/zend_extensions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ END_EXTERN_C()
111111
ZEND_API extern zend_llist zend_extensions;
112112

113113
void zend_extension_dtor(zend_extension *extension);
114-
void zend_append_version_info(const zend_extension *extension);
114+
ZEND_API void zend_append_version_info(const zend_extension *extension);
115115
int zend_startup_extensions_mechanism(void);
116116
int zend_startup_extensions(void);
117117
void zend_shutdown_extensions(TSRMLS_D);

Zend/zend_object_handlers.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,6 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
786786
/* we don't have access controls - will just add it */
787787
new_zval = &EG(uninitialized_zval);
788788

789-
if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
790-
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
791-
}
792789
Z_ADDREF_P(new_zval);
793790
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
794791
property_info->offset >= 0) {
@@ -808,6 +805,12 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
808805
}
809806
zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval);
810807
}
808+
809+
/* Notice is thrown after creation of the property, to avoid EG(std_property_info)
810+
* being overwritten in an error handler. */
811+
if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
812+
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
813+
}
811814
} else {
812815
/* we do have getter - fail and let it try again with usual get/set */
813816
retval = NULL;

Zend/zend_variables.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
138138
ALLOC_HASHTABLE_REL(tmp_ht);
139139
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
140140
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
141+
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
141142
zvalue->value.ht = tmp_ht;
142143
}
143144
break;

configure.in

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
119119

120120
PHP_MAJOR_VERSION=5
121121
PHP_MINOR_VERSION=6
122-
PHP_RELEASE_VERSION=1
122+
PHP_RELEASE_VERSION=3
123123
PHP_EXTRA_VERSION="-dev"
124124
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
125125
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
@@ -787,7 +787,12 @@ if test "$PHP_GCOV" = "yes"; then
787787
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
788788
fi
789789

790-
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
790+
dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
791+
ltp_version_min="105"
792+
dnl non-working versions, e.g. "1.8 1.18";
793+
dnl remove "none" when introducing the first incompatible LTP version an
794+
dnl separate any following additions by spaces
795+
ltp_version_exclude="1.8"
791796

792797
AC_CHECK_PROG(LTP, lcov, lcov)
793798
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
@@ -797,21 +802,30 @@ if test "$PHP_GCOV" = "yes"; then
797802
if test "$LTP"; then
798803
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
799804
php_cv_ltp_version=invalid
800-
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
801-
for ltp_check_version in $ltp_version_list; do
802-
if test "$ltp_version" = "$ltp_check_version"; then
803-
php_cv_ltp_version="$ltp_check_version (ok)"
805+
ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
806+
if test -n "$ltp_version_vars"; then
807+
set $ltp_version_vars
808+
ltp_version="${1}.${2}"
809+
ltp_version_num="`expr ${1} \* 100 + ${2}`"
810+
if test $ltp_version_num -ge $ltp_version_min; then
811+
php_cv_ltp_version="$ltp_version (ok)"
812+
for ltp_check_version in $ltp_version_exclude; do
813+
if test "$ltp_version" = "$ltp_check_version"; then
814+
php_cv_ltp_version=invalid
815+
break
816+
fi
817+
done
804818
fi
805-
done
819+
fi
806820
])
807821
else
808-
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
822+
ltp_msg="To enable code coverage reporting you must have LTP installed"
809823
AC_MSG_ERROR([$ltp_msg])
810824
fi
811825

812826
case $php_cv_ltp_version in
813827
""|invalid[)]
814-
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
828+
ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
815829
AC_MSG_ERROR([$ltp_msg])
816830
LTP="exit 0;"
817831
;;

0 commit comments

Comments
 (0)