Skip to content

Commit 557200b

Browse files
author
Jerome Loyet
committed
Merge branch 'PHP-5.3' of git.php.net:php-src into PHP-5.3
* 'PHP-5.3' of git.php.net:php-src: (59 commits) Fixed defective cloning in ext/intl classes Fixed bug (segfault while build with zts and GOTO vm-kind) better fix Fix test Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray) ZTS fix introduced by Felipe must also go into 5.3 Updated INSTALL. Generated from the XML Docs. Update NEWS given a5d0c1e Fix handling of several uinitialized intl objects Fixed bug #62885 (mysqli_poll - Segmentation fault) - Removed PHP 6 checks skip test properly Added test for bug #51353. It'll be skipped by default and must be activated manually. Move test files to tests dir skip test for bug 43130 on firebird , not relevant - Value stored to var is never used - Value stored to var is never used - Value stored to var is never used - Value stored to var is never used - Value stored to var is never used ...
2 parents 5799ebd + 0410b4e commit 557200b

File tree

404 files changed

+1543
-455
lines changed

Some content is hidden

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

404 files changed

+1543
-455
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ext/dba/libflatfile/flatfile.c ident
1515
ext/dba/libcdb/cdb_make.c ident
1616
ext/dba/libcdb/cdb.c ident
1717
ext/filter/filter.c ident
18+
ext/zip/php_zip.c ident
1819
README.input_filter ident
1920
run-tests.php ident
2021
sapi/nsapi/nsapi.c ident

INSTALL

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

NEWS

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,54 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2012, PHP 5.3.16
44

5+
- Core:
6+
. Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
7+
. Fixed bug #62763 (register_shutdown_function and extending class).
8+
(Laruence)
9+
. Fixed bug #62744 (dangling pointers made by zend_disable_class). (Laruence)
10+
. Fixed bug #62716 (munmap() is called with the incorrect length).
11+
12+
. Fixed bug ##62460 (php binaries installed as binary.dSYM). (Reeze Xia)
13+
. Fixed bug #60194 (--with-zend-multibyte and --enable-debug reports LEAK
14+
with run-test.php). (Laruence)
15+
516
- CURL:
17+
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
618
. Fixed bug #62499 (curl_setopt($ch, CURLOPT_COOKIEFILE, "") returns false).
719
([email protected], Laruence)
820

921
- DateTime:
10-
. Fixed Bug #62500 (Segfault in DateInterval class when extended). (Laruence)
22+
. Fixed bug #62852 (Unserialize invalid DateTime causes crash).
23+
24+
. Fixed bug #62500 (Segfault in DateInterval class when extended). (Laruence)
25+
26+
- Intl:
27+
. Fix null pointer dereferences in some classes of ext/intl. (Gustavo)
28+
. Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
29+
30+
- MySQLnd:
31+
. Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence)
32+
33+
- PDO:
34+
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
35+
36+
- Reflection:
37+
. Fixed bug #62715 (ReflectionParameter::isDefaultValueAvailable() wrong
38+
result). (Laruence)
39+
40+
- Session:
41+
. Fixed bug (segfault due to retval is not initialized). (Laruence)
1142

1243
- SPL:
44+
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
45+
(Laruence)
1346
. Fixed bug #62616 (ArrayIterator::count() from IteratorIterator instance
1447
gives Segmentation fault). (Laruence, Gustavo)
1548

49+
- Enchant:
50+
. Fixed bug #62838 (enchant_dict_quick_check() destroys zval, but fails to
51+
initialize it). (Tony, Mateusz Goik).
52+
1653
19 Jul 2012, PHP 5.3.15
1754

1855
- Zend Engine:

Zend/tests/bug55509.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Bug #55509 (segfault on x86_64 using more than 2G memory)
55
if (PHP_INT_SIZE == 4) {
66
die('skip Not for 32-bits OS');
77
}
8+
9+
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
10+
if ($zend_mm_enabled === "0") {
11+
die("skip Zend MM disabled");
12+
}
13+
814
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
915
// check the available memory
1016
if (PHP_OS == 'Linux') {

Zend/tests/bug62680.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Bug #62680 (Function isset() throws fatal error on set array if non-existent key depth >= 3)
3+
--XFAIL--
4+
see https://bugs.php.net/62680
5+
--FILE--
6+
<?php
7+
$array = array("");
8+
var_dump(isset($array[0]["a"]["b"]));
9+
var_dump(isset($array[0]["a"]["b"]["c"]));
10+
?>
11+
--EXPECT--
12+
bool(false)
13+
bool(false)

Zend/tests/bug62763.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Bug #62763 (register_shutdown_function and extending class)
3+
--FILE--
4+
<?php
5+
class test1 {
6+
public function __construct() {
7+
register_shutdown_function(array($this, 'shutdown'));
8+
}
9+
public function shutdown() {
10+
exit(__METHOD__);
11+
}
12+
}
13+
14+
class test2 extends test1 {
15+
public function __destruct() {
16+
exit (__METHOD__);
17+
}
18+
}
19+
new test1;
20+
new test2;
21+
?>
22+
--EXPECT--
23+
test1::shutdowntest2::__destruct

Zend/zend_API.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,16 +2342,15 @@ static const zend_function_entry disabled_class_new[] = {
23422342

23432343
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
23442344
{
2345-
zend_class_entry disabled_class;
2345+
zend_class_entry **disabled_class;
23462346

23472347
zend_str_tolower(class_name, class_name_length);
2348-
if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
2348+
if (zend_hash_find(CG(class_table), class_name, class_name_length+1, (void **)&disabled_class)==FAILURE) {
23492349
return FAILURE;
23502350
}
2351-
INIT_OVERLOADED_CLASS_ENTRY_EX(disabled_class, class_name, class_name_length, disabled_class_new, NULL, NULL, NULL, NULL, NULL);
2352-
disabled_class.create_object = display_disabled_class;
2353-
disabled_class.name_length = class_name_length;
2354-
zend_register_internal_class(&disabled_class TSRMLS_CC);
2351+
INIT_CLASS_ENTRY_INIT_METHODS((**disabled_class), disabled_class_new, NULL, NULL, NULL, NULL, NULL);
2352+
(*disabled_class)->create_object = display_disabled_class;
2353+
zend_hash_clean(&((*disabled_class)->function_table));
23552354
return SUCCESS;
23562355
}
23572356
/* }}} */
@@ -2425,7 +2424,6 @@ static int zend_is_callable_check_class(const char *name, int name_len, zend_fca
24252424
}
24262425
/* }}} */
24272426

2428-
24292427
static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */
24302428
{
24312429
zend_class_entry *ce_org = fcc->calling_scope;
@@ -2447,11 +2445,9 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
24472445
/* Skip leading \ */
24482446
if (Z_STRVAL_P(callable)[0] == '\\') {
24492447
mlen = Z_STRLEN_P(callable) - 1;
2450-
mname = Z_STRVAL_P(callable) + 1;
24512448
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable) + 1, mlen);
24522449
} else {
24532450
mlen = Z_STRLEN_P(callable);
2454-
mname = Z_STRVAL_P(callable);
24552451
lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), mlen);
24562452
}
24572453
/* Check if function with given name exists.

Zend/zend_API.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ typedef struct _zend_fcall_info_cache {
170170
int _len = class_name_len; \
171171
class_container.name = zend_strndup(class_name, _len); \
172172
class_container.name_length = _len; \
173+
INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
174+
}
175+
176+
#define INIT_CLASS_ENTRY_INIT_METHODS(class_container, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
177+
{ \
173178
class_container.builtin_functions = functions; \
174179
class_container.constructor = NULL; \
175180
class_container.destructor = NULL; \

Zend/zend_language_scanner.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */
1+
/* Generated by re2c 0.13.5 on Sat Jul 28 16:59:07 2012 */
22
#line 1 "Zend/zend_language_scanner.l"
33
/*
44
+----------------------------------------------------------------------+
@@ -287,7 +287,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
287287
zend_multibyte_set_filter(NULL TSRMLS_CC);
288288

289289
if (!SCNG(input_filter)) {
290-
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
290+
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
291291
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
292292
SCNG(script_filtered_size) = SCNG(script_org_size);
293293
} else {
@@ -445,7 +445,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
445445
zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC);
446446

447447
if (!SCNG(input_filter)) {
448-
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
448+
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
449449
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
450450
SCNG(script_filtered_size) = SCNG(script_org_size);
451451
} else {

Zend/zend_language_scanner.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
285285
zend_multibyte_set_filter(NULL TSRMLS_CC);
286286

287287
if (!SCNG(input_filter)) {
288-
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
288+
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
289289
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
290290
SCNG(script_filtered_size) = SCNG(script_org_size);
291291
} else {
@@ -443,7 +443,7 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
443443
zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC);
444444

445445
if (!SCNG(input_filter)) {
446-
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+1);
446+
SCNG(script_filtered) = (unsigned char*)emalloc(SCNG(script_org_size)+2);
447447
memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1);
448448
SCNG(script_filtered_size) = SCNG(script_org_size);
449449
} else {

0 commit comments

Comments
 (0)