Skip to content

Commit 6e32a87

Browse files
author
Stanley Sufficool
committed
Merge branch 'PHP-5.3' of https://git.php.net/push/php-src into PHP-5.3
* 'PHP-5.3' of https://git.php.net/push/php-src: (23 commits) Merge PHP 5.3.27 NEWS add test for bug #65236 truncate results at depth of 255 to prevent corruption fix assembly of safe_address() for x86 and x86_64 Add bison 2.6.4 to the list of supported versions Update git rules (5.5 is stable, 5.3 sec only) This will be PHP 5.3.28 Fixed bug #63186 (compile failure on netbsd) ensure the error_reporting level to get expected notice fixed tests missing tests for bug #53437 missing colon Backported the fix for bug #53437 Fixed test script Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on 64-bits systems) Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC) Fixed bug #64934 Apache2 TS crash with get_browser() Add NEWS for PHP 5.3.26 Fixed bug #64960 (Segfault in gc_zval_possible_root) fix CVE-2013-2110 - use correct formula to calculate string size ...
2 parents 598e269 + e2e002d commit 6e32a87

Some content is hidden

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

42 files changed

+1262
-122
lines changed

NEWS

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? 2013, PHP 5.3.27
3+
?? ??? 2013, PHP 5.3.28
4+
5+
11 Jul 2013, PHP 5.3.27
6+
7+
- Core:
8+
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
9+
. Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
10+
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
11+
. Fixed bug #63186 (compile failure on netbsd). (Matteo)
12+
13+
- DateTime:
14+
. Fixed bug #53437 (Crash when using unserialized DatePeriod instance).
15+
(Gustavo, Derick, Anatol)
416

517
- PDO_firebird:
618
. Fixed bug #64037 (Firebird return wrong value for numeric field).
@@ -11,9 +23,21 @@ PHP NEWS
1123
- PDO_pgsql:
1224
. Fixed bug #64949 (Buffer overflow in _pdo_pgsql_error). (Remi)
1325

14-
?? ??? 2013, PHP 5.3.26
26+
- pgsql:
27+
. Fixed bug #64609 (pg_convert enum type support). (Matteo)
1528

16-
### DO NOT ADD ENTRIES HERE, ADD THEM ABOVE FOR 5.3.27 ###
29+
- SPL:
30+
. Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on
31+
64-bits systems). (Laruence)
32+
33+
- XML:
34+
. Fixed bug #65236 (heap corruption in xml parser). (Rob)
35+
36+
06 Jun 2013, PHP 5.3.26
37+
38+
- Core:
39+
. Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode,
40+
CVE 2013-2110). (Stas)
1741

1842
- Calendar:
1943
. Fixed bug #64895 (Integer overflow in SndToJewish). (Remi)

README.GIT-RULES

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ Currently we have the following branches in use::
4545

4646
master The active development branch.
4747

48-
PHP-5.4 Is used to release the PHP 5.4.x series. It still allows for
49-
larger enhancements.
48+
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
49+
stable version and is open for bugfixes only.
5050

51-
PHP-5.3 Is used to release the PHP 5.3.x series. This is current
51+
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
5252
stable version and is open for bugfixes only.
5353

54-
PHP-5.2 Is used to release the PHP 5.2.x series. It is closed for
55-
changes now.
54+
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
55+
in extended support and open forsecurity fixes only. Triaged
56+
via security@php.net
57+
58+
PHP-5.2 This branch is closed.
5659

5760
PHP-5.1 This branch is closed.
5861

Zend/acinclude.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
44

55
AC_DEFUN([LIBZEND_BISON_CHECK],[
66
# we only support certain bison versions
7-
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
7+
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4"
88
99
# for standalone build of Zend Engine
1010
test -z "$SED" && SED=sed

Zend/tests/bug64960.phpt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--TEST--
2+
Bug #64960 (Segfault in gc_zval_possible_root)
3+
--FILE--
4+
<?php
5+
// this makes ob_end_clean raise an error
6+
ob_end_flush();
7+
8+
class ExceptionHandler {
9+
public function __invoke (Exception $e)
10+
{
11+
// this triggers the custom error handler
12+
ob_end_clean();
13+
}
14+
}
15+
16+
// this must be a class, closure does not trigger segfault
17+
set_exception_handler(new ExceptionHandler());
18+
19+
// exception must be throwed from error handler.
20+
set_error_handler(function()
21+
{
22+
$e = new Exception;
23+
$e->_trace = debug_backtrace();
24+
25+
throw $e;
26+
});
27+
28+
// trigger error handler
29+
$a['waa'];
30+
?>
31+
--EXPECTF--
32+
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
33+
34+
Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
35+
Stack trace:
36+
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
37+
#1 %sbug64960.php(9): ob_end_clean()
38+
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
39+
#3 {main}
40+
thrown in %sbug64960.php on line 19

Zend/tests/bug64966.phpt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
3+
--FILE--
4+
<?php
5+
error_reporting(E_ALL);
6+
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
7+
8+
function test($func) {
9+
$a = $func("");
10+
return true;
11+
}
12+
class A {
13+
public function b() {
14+
test("strlen");
15+
test("iterator_apply");
16+
}
17+
}
18+
19+
$a = new A();
20+
$a->b();
21+
?>
22+
--EXPECTF--
23+
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
24+
Stack trace:
25+
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
26+
#1 %sbug64966.php(6): iterator_apply('')
27+
#2 %sbug64966.php(12): test('iterator_apply')
28+
#3 %sbug64966.php(17): A->b()
29+
#4 {main}
30+
thrown in %sbug64966.php on line 3

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
23862386
size_t res = nmemb;
23872387
unsigned long overflow = 0;
23882388

2389-
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
2389+
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
23902390
: "=&a"(res), "=&d" (overflow)
23912391
: "%0"(res),
23922392
"rm"(size),
@@ -2406,7 +2406,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24062406
size_t res = nmemb;
24072407
unsigned long overflow = 0;
24082408

2409-
__asm__ ("mulq %3\n\taddq %4,%0\n\tadcq %1,%1"
2409+
__asm__ ("mulq %3\n\taddq %4,%0\n\tadcq $0,%1"
24102410
: "=&a"(res), "=&d" (overflow)
24112411
: "%0"(res),
24122412
"rm"(size),

Zend/zend_execute_API.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,13 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
263263
if (EG(user_error_handler)) {
264264
zeh = EG(user_error_handler);
265265
EG(user_error_handler) = NULL;
266-
zval_dtor(zeh);
267-
FREE_ZVAL(zeh);
266+
zval_ptr_dtor(&zeh);
268267
}
269268

270269
if (EG(user_exception_handler)) {
271270
zeh = EG(user_exception_handler);
272271
EG(user_exception_handler) = NULL;
273-
zval_dtor(zeh);
274-
FREE_ZVAL(zeh);
272+
zval_ptr_dtor(&zeh);
275273
}
276274

277275
zend_stack_destroy(&EG(user_error_handlers_error_reporting));

Zend/zend_vm_def.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,6 +2327,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
23272327
if (!RETURN_VALUE_USED(opline)) {
23282328
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
23292329
}
2330+
} else if (RETURN_VALUE_USED(opline)) {
2331+
EX_T(opline->result.u.var).var.ptr = NULL;
23302332
}
23312333
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
23322334
EX(original_return_value) = EG(return_value_ptr_ptr);

Zend/zend_vm_execute.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
327327
if (!RETURN_VALUE_USED(opline)) {
328328
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
329329
}
330+
} else if (RETURN_VALUE_USED(opline)) {
331+
EX_T(opline->result.u.var).var.ptr = NULL;
330332
}
331333
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
332334
EX(original_return_value) = EG(return_value_ptr_ptr);

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
4141

4242
PHP_MAJOR_VERSION=5
4343
PHP_MINOR_VERSION=3
44-
PHP_RELEASE_VERSION=27
44+
PHP_RELEASE_VERSION=28
4545
PHP_EXTRA_VERSION="-dev"
4646
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
4747
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`

0 commit comments

Comments
 (0)