Skip to content

Commit 9aa904c

Browse files
author
Stanley Sufficool
committed
Merge branch 'PHP-5.4' of https://git.php.net/push/php-src into PHP-5.4
* 'PHP-5.4' of https://git.php.net/push/php-src: (140 commits) Copy dba_*() keys before converting to string. Fix the broken sh syntax in ext/imap/config.m4. Revert "EmptyIterator now implements Countable; fixes bug 60577" RFC 6598 reserved ip range starts at 100.64.0.0 fix a very rare case of use of uninitialized value combined with a memleak NEWS for added reserved ip addresses according to RFC 6598 Add RFC 6598 IPs to reserved addresses NEWS for #60577 NEWS for bug #64441 Fix bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names) EmptyIterator now implements Countable; fixes bug 60577 News for bugfix #64157 Bug 64157 Changed error message to make sense Tinker with the wording of the short_open_tag description. Handle CLI server request headers case insensitively. 5.4.21 now Typo.... Add a XFAIL test for #64896 Fixed Bug #65564 stack-buffer-overflow in DateTimeZone stuff caught by AddressSanitizer Fixed bug #60598 (cli/apache sapi segfault on objects manipulation) ...
2 parents 67c03ea + 30e0442 commit 9aa904c

File tree

292 files changed

+3466
-1278
lines changed

Some content is hidden

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

292 files changed

+3466
-1278
lines changed

Makefile.global

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ all: $(all_targets)
1010
@echo "Build complete."
1111
@echo "Don't forget to run 'make test'."
1212
@echo
13-
13+
1414
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
1515

1616
build-binaries: $(PHP_BINARIES)
@@ -116,7 +116,7 @@ clean:
116116
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
117117

118118
distclean: clean
119-
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
119+
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak
120120
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
121121

122122
.PHONY: all clean install distclean test

NEWS

Lines changed: 126 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,119 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? 2013, PHP 5.4.18
3+
?? ??? 2013, PHP 5.4.21
4+
5+
- CLI server:
6+
. Fixed bug #65633 (built-in server treat some http headers as
7+
case-sensitive). (Adam)
8+
9+
- Datetime:
10+
. Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
11+
message). (Boro Sitnikovski)
12+
13+
- DBA extension:
14+
. Fixed bug #65708 (dba functions cast $key param to string in-place,
15+
bypassing copy on write). (Adam)
16+
17+
- Filter:
18+
. Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn)
19+
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
20+
(Syra)
21+
22+
- IMAP:
23+
. Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
24+
imap). (ryotakatsuki at gmail dot com)
25+
26+
?? ??? 2013, PHP 5.4.20
27+
28+
- Core:
29+
. Fixed bug #60598 (cli/apache sapi segfault on objects manipulation).
30+
(Laruence)
31+
. Fixed bug #65579 (Using traits with get_class_methods causes segfault).
32+
(Adam)
33+
. Fixed bug #65490 (Duplicate calls to get lineno & filename for
34+
DTRACE_FUNCTION_*). (Chris Jones)
35+
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
36+
spaces). (Michael M Slusarz)
37+
. Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
38+
. Fixed bug #65470 (Segmentation fault in zend_error() with
39+
--enable-dtrace). (Chris Jones, Kris Van Hees)
40+
. Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference
41+
fails). (Laruence)
42+
. Fixed bug #65304 (Use of max int in array_sum). (Laruence)
43+
. Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very
44+
limited case). (Arpad)
45+
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
46+
. Improved fix for bug #63186 (compile failure on netbsd). (Matteo)
47+
. Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees)
48+
. Fixed bug #61759 (class_alias() should accept classes with leading
49+
backslashes). (Julien)
50+
. Fixed bug #61345 (CGI mode - make install don't work). (Michael Heimpold)
51+
. Cherry-picked some DTrace build commits (allowing builds on Linux,
52+
bug #62691, and bug #63706) from PHP 5.5 branch
53+
. Fixed bug #61268 (--enable-dtrace leads make to clobber
54+
Zend/zend_dtrace.d) (Chris Jones)
55+
56+
- cURL:
57+
. Fixed bug #65458 (curl memory leak). (Adam)
58+
59+
- Datetime:
60+
. Fixed bug #65554 (createFromFormat broken when weekday name is followed
61+
by some delimiters). (Valentin Logvinskiy, Stas).
62+
. Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught
63+
by AddressSanitizer). (Remi).
64+
65+
- Openssl:
66+
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
67+
some cases). (Mark Jones)
68+
69+
- Session:
70+
. Fixed bug #62129 (rfc1867 crashes php even though turned off). (gxd305 at
71+
gmail dot com)
72+
. Fixed bug #50308 (session id not appended properly for empty anchor tags).
73+
(Arpad)
74+
. Fixed possible buffer overflow under Windows. Note: Not a security fix.
75+
(Yasuo)
76+
. Changed session.auto_start to PHP_INI_PERDIR. (Yasuo)
77+
78+
- SOAP:
79+
. Fixed bug #65018 (SoapHeader problems with SoapServer). (Dmitry)
80+
81+
- SPL:
82+
. Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence)
83+
84+
- PDO:
85+
. Fixed bug #64953 (Postgres prepared statement positional parameter
86+
casting). (Mike)
87+
88+
- Phar:
89+
. Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for
90+
some specific contents). (Stas)
91+
92+
- Pgsql:
93+
. Fixed bug #65336 (pg_escape_literal/identifier() silently returns false).
94+
(Yasuo)
95+
. Fixed bug #62978 (Disallow possible SQL injections with pg_select()/pg_update()
96+
/pg_delete()/pg_insert()). (Yasuo)
97+
98+
- Zlib:
99+
. Fixed bug #65391 (Unable to send vary header user-agent when
100+
ob_start('ob_gzhandler') is called) (Mike)
101+
102+
22 Aug 2013, PHP 5.4.19
4103

5104
- Core:
105+
. Fixed bug #64503 (Compilation fails with error: conflicting types for
106+
'zendparse'). (Laruence)
107+
108+
- Openssl:
109+
. Fixed UMR in fix for CVE-2013-4248.
110+
111+
15 Aug 2013, PHP 5.4.18
112+
113+
- Core:
114+
. Fixed value of FILTER_SANITIZE_FULL_SPECIAL_CHARS constant (previously was
115+
erroneously set to FILTER_SANITIZE_SPECIAL_CHARS value). (Andrey
116+
avp200681 gmail com).
6117
. Fixed bug #65254 (Exception not catchable when exception thrown in autoload
7118
with a namespace). (Laruence)
8119
. Fixed bug #65108 (is_callable() triggers Fatal Error).
@@ -24,6 +135,9 @@ PHP NEWS
24135
. Fixed bug #65066 (Cli server not responsive when responding with 422 http
25136
status code). (Adam)
26137

138+
- CURL:
139+
. Fixed bug #62665 (curl.cainfo doesn't appear in php.ini). (Lior Kaplan)
140+
27141
- FPM:
28142
. Fixed bug #63983 (enabling FPM borks compile on FreeBSD).
29143
(chibisuke at web dot de, Felipe)
@@ -51,10 +165,18 @@ PHP NEWS
51165
. Fixed bug #61387 (NULL valued anonymous column causes segfault in
52166
odbc_fetch_array). (Brandon Kirsch)
53167

168+
- Openssl:
169+
. Fixed handling null bytes in subjectAltName (CVE-2013-4248).
170+
(Christian Heimes)
171+
54172
- PDO:
55173
. Allowed PDO_OCI to compile with Oracle Database 12c client libraries.
56174
(Chris Jones)
57175

176+
- PDO_dblib:
177+
. Fixed bug #65219 (PDO/dblib not working anymore ("use dbName" not sent)).
178+
(Stanley Sufficool)
179+
58180
- PDO_pgsql:
59181
. Fixed meta data retrieve when OID is larger than 2^31. (Yasuo)
60182

@@ -80,6 +202,9 @@ PHP NEWS
80202
. Fixed bug #60560 (SplFixedArray un-/serialize, getSize(), count() return 0,
81203
keys are strings). (Adam)
82204

205+
- XML:
206+
. Fixed bug #65236 (heap corruption in xml parser, CVE-2013-4113). (Rob)
207+
83208
04 Jul 2013, PHP 5.4.17
84209

85210
- Core:

TSRM/tsrm_win32.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ TSRM_API int shmget(int key, int size, int flags)
625625
shm->info = info_handle;
626626
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
627627

628-
if (created) {
628+
if (NULL != shm->descriptor && created) {
629629
shm->descriptor->shm_perm.key = key;
630630
shm->descriptor->shm_segsz = size;
631631
shm->descriptor->shm_ctime = time(NULL);
@@ -639,8 +639,10 @@ TSRM_API int shmget(int key, int size, int flags)
639639
shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0;
640640
}
641641

642-
if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) {
643-
CloseHandle(shm->segment);
642+
if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) {
643+
if (NULL != shm->segment) {
644+
CloseHandle(shm->segment);
645+
}
644646
UnmapViewOfFile(shm->descriptor);
645647
CloseHandle(shm->info);
646648
return -1;

Zend/README.ZEND_VM

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fields and using different execution methods (call threading, switch threading
66
and direct threading). As a result ZE2 got more than 20% speedup on raw PHP
77
code execution (with specialized executor and direct threading execution
88
method). As in most PHP applications raw execution speed isn't the limiting
9-
factor but system calls and database callls are, your mileage with this patch
9+
factor but system calls and database calls are, your mileage with this patch
1010
will vary.
1111

1212
Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can

Zend/ZEND_CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ Changes in the Zend Engine 1.0
11361136
(supports breakpoints, expression evaluation, step-in/over,
11371137
function call backtrace, and more).
11381138

1139-
The Zend Engine claims 100% compatability with the engine of PHP
1139+
The Zend Engine claims 100% compatibility with the engine of PHP
11401140
3.0, and is shamelessly lying about it. Here's why:
11411141

11421142
* Static variable initializers only accept scalar values
@@ -1161,6 +1161,6 @@ Changes in the Zend Engine 1.0
11611161
printed the letter { and the contents of the variable $somevar in
11621162
PHP 3.0), it will result in a parse error with the Zend Engine.
11631163
In this case, you would have to change the code to print
1164-
"\{$somevar"; This incompatability is due to the full variable
1164+
"\{$somevar"; This incompatibility is due to the full variable
11651165
reference within quoted strings feature added in the Zend
11661166
Engine.

Zend/tests/bug60598.phpt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Bug #60598 (cli/apache sapi segfault on objects manipulation)
3+
--FILE--
4+
<?php
5+
define('OBJECT_COUNT', 10000);
6+
7+
$containers = array();
8+
9+
class Object {
10+
protected $_guid = 0;
11+
public function __construct() {
12+
global $containers;
13+
$this->guid = 1;
14+
$containers[spl_object_hash($this)] = $this;
15+
}
16+
public function __destruct() {
17+
global $containers;
18+
$containers[spl_object_hash($this)] = NULL;
19+
}
20+
}
21+
22+
for ($i = 0; $i < OBJECT_COUNT; ++$i) {
23+
new Object();
24+
}
25+
26+
// You probably won't see this because of the "zend_mm_heap corrupted"
27+
?>
28+
If you see this, try to increase OBJECT_COUNT to 100,000
29+
--EXPECT--
30+
If you see this, try to increase OBJECT_COUNT to 100,000

Zend/tests/bug60771.phpt

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

Zend/tests/bug64896.phpt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--TEST--
2+
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
3+
--XFAIL--
4+
We can not fix this bug without a significant (performace slow down) change to gc
5+
--FILE--
6+
<?php
7+
$bar = NULL;
8+
class bad
9+
{
10+
private $_private = array();
11+
12+
public function __construct()
13+
{
14+
$this->_private[] = 'php';
15+
}
16+
17+
public function __destruct()
18+
{
19+
global $bar;
20+
$bar = $this;
21+
}
22+
}
23+
24+
$foo = new stdclass;
25+
$foo->foo = $foo;
26+
$foo->bad = new bad;
27+
28+
gc_disable();
29+
30+
unserialize(serialize($foo));
31+
gc_collect_cycles();
32+
var_dump($bar);
33+
/* will output:
34+
object(bad)#4 (1) {
35+
["_private":"bad":private]=>
36+
&UNKNOWN:0
37+
}
38+
*/
39+
?>
40+
--EXPECTF--
41+
bject(bad)#%d (1) {
42+
["_private":"bad":private]=>
43+
array(1) {
44+
[0]=>
45+
string(3) "php"
46+
}
47+
}

Zend/tests/bug65291.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Bug #65291 - get_defined_constants() causes PHP to crash in a very limited case.
3+
--FILE--
4+
<?php
5+
6+
trait TestTrait
7+
{
8+
public static function testStaticFunction()
9+
{
10+
return __CLASS__;
11+
}
12+
}
13+
class Tester
14+
{
15+
use TestTrait;
16+
}
17+
18+
$foo = Tester::testStaticFunction();
19+
get_defined_constants();
20+
get_defined_constants(true);
21+
22+
echo $foo;
23+
?>
24+
--EXPECT--
25+
Tester

Zend/tests/bug65372.phpt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--TEST--
2+
Bug #65372 (Segfault in gc_zval_possible_root when return reference fails)
3+
--FILE--
4+
<?php
5+
6+
class ParentClass
7+
{
8+
private static $_OBJECTS;
9+
10+
public static function Get()
11+
{
12+
self::$_OBJECTS[1] = new ChildClass();
13+
return self::$_OBJECTS[1];
14+
}
15+
}
16+
17+
class ChildClass extends ParentClass
18+
{
19+
public $Manager;
20+
21+
function __construct()
22+
{
23+
$this->Manager = $this;
24+
}
25+
26+
public static function &GetCurrent()
27+
{
28+
return ChildClass::Get();
29+
}
30+
31+
public static function &Get()
32+
{
33+
return parent::Get();
34+
}
35+
}
36+
37+
$staff = ChildClass::GetCurrent();
38+
?>
39+
--EXPECTF--
40+
Notice: Only variable references should be returned by reference in %sbug65372.php on line 30

0 commit comments

Comments
 (0)