Compare commits

...
86 Commits
Author SHA1 Message Date
Joe Watkins 058de87e99 set versions 2017-10-25 08:02:18 +01:00
Joe Watkins 9d35dd56e7 news entries 2017-10-24 16:39:31 +01:00
Anatol Belski 2eef522b1c Fix test 2017-10-24 16:38:13 +01:00
Anatol Belski edb6adef36 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72535 arcfour encryption stream filter crashes php
2017-10-24 16:37:56 +01:00
Anatol Belski 5c0455bf2c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75055 Out-Of-Bounds Read in timelib_meridian()
  Apply upstream patch for CVE-2016-1283
2017-10-24 16:36:21 +01:00
Joe Watkins 5c81d85bd1 php-7.1.11 2017-10-10 16:10:37 +01:00
Christoph M. Becker fee21a45df Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] Add NEWS entry for bug #75349
2017-10-10 13:56:47 +02:00
Christoph M. Becker c8eccf8451 [ci skip] Add NEWS entry for bug #75349 2017-10-10 13:54:52 +02:00
Anatol Belski 30f121f9bc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix re2c version detection
2017-10-10 12:59:14 +02:00
Anatol Belski d1fc9b425f Fix re2c version detection 2017-10-10 10:52:52 +02:00
Anatol Belski c8732b1c5f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Move dev to 7.0.26
2017-10-10 08:27:37 +02:00
Anatol Belski 51658bac35 Move dev to 7.0.26 2017-10-10 08:26:04 +02:00
Anatol Belski d8881f4eb4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix array access on undeclared properties in DateInterval
2017-10-09 15:38:21 +02:00
Anatol Belski f48abfa902 Fix array access on undeclared properties in DateInterval 2017-10-09 15:35:38 +02:00
Anatol Belski dc3b9fe619 Fix ftok() multibyte path support 2017-10-09 13:12:40 +02:00
Sara Golemon ac1fd769ad Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS
2017-10-07 10:13:54 -04:00
Sara Golemon 843e492c68 Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS 2017-10-07 10:08:34 -04:00
Christoph M. Becker 0f55138533 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75318 (The parameter of UConverter::getAliases() is not optional)
2017-10-06 16:46:51 +02:00
Christoph M. Becker ec3d864784 Fixed bug #75318 (The parameter of UConverter::getAliases() is not optional)
Of course, reflection has to know that as well.
2017-10-06 16:45:07 +02:00
Nikita Popov d34c8fa802 Merge branch 'PHP-7.0' into PHP-7.1 2017-10-05 12:25:37 +02:00
Mathieu CARBONNEAUX 6b9ccda936 Fixed bug #75311 2017-10-05 12:24:57 +02:00
Dmitry Stogov b6e34eaf04 Fixed rarely possible use-after-free 2017-10-04 16:38:55 +03:00
Dmitry Stogov c935b832dc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bumped ext/oci8 version
  Use dereferenced value
  Fixed compilation errors
  Restored code for BOOL variables
  Fixed few ext/oci8 bugs
2017-10-04 09:58:32 +03:00
Dmitry Stogov 1195de87ff Bumped ext/oci8 version 2017-10-04 09:56:25 +03:00
Dmitry Stogov ee50fcfa27 Merge branch 'oci8_fix' into PHP-7.0
* oci8_fix:
  Use dereferenced value
  Fixed compilation errors
  Restored code for BOOL variables
  Fixed few ext/oci8 bugs
2017-10-04 09:49:40 +03:00
Dmitry Stogov 24e595bf26 Use dereferenced value 2017-10-03 10:49:56 +03:00
Joe Watkins d0cda9d0bd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Typo in status.html
2017-10-03 07:22:04 +01:00
Viktor Szépe e995b7e475 Typo in status.html
feet needs -> fit needs
2017-10-03 07:21:53 +01:00
Joe Watkins 1322c2c86a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #74905
2017-10-03 07:19:00 +01:00
Peter Kokot 6d1dd8b0af Fix bug #74905 2017-10-03 07:18:38 +01:00
Joe Watkins 2019b25daa Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Remove ident gitattribute for ext/zip/php_zip.c
2017-10-03 07:15:02 +01:00
Peter Kokot 7b248a1b32 Remove ident gitattribute for ext/zip/php_zip.c 2017-10-03 07:14:50 +01:00
Dmitry Stogov 4d69587035 Fixed compilation errors 2017-10-03 09:08:28 +03:00
Dmitry Stogov c8dea7ae1e Restored code for BOOL variables 2017-10-02 17:04:26 +03:00
Remi Collet 03aef5f65c NEWS 2017-10-02 11:26:08 +02:00
Remi Collet fa78afa112 Fixed bug #75303 sha3 hangs on bigendian 2017-10-02 11:25:23 +02:00
Andrea Faulds 4372293192 Merge branch 'PHP-7.0' into PHP-7.1 2017-09-29 21:38:30 +01:00
Andrea Faulds abefb6dfe7 Fix bug #75290 2017-09-29 21:38:08 +01:00
Xinchen Hui 9fd33c1f20 Fixed bug #75267 (possible &/&& mixup) 2017-09-29 11:16:32 +08:00
Sara Golemon b5bc88c64e Fix word alignment on ILP64. 2017-09-28 10:45:51 -04:00
Anatol Belski db9778dfb2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Apply upstream patch for CVE-2016-1283
2017-09-28 15:44:40 +02:00
Anatol Belski d11fceab15 Apply upstream patch for CVE-2016-1283
Fix bug #75207, see also
https://bugzilla.redhat.com/show_bug.cgi?id=1295385
https://vcs.pcre.org/pcre?view=revision&revision=1636
2017-09-28 15:40:49 +02:00
Anatol Belski 72c008f945 Fix mkdir() special case for path length < 260 and > 248 2017-09-28 13:18:31 +02:00
Dmitry Stogov 1c68d63f35 Fixed bug #75255 (Request hangs and not finish) 2017-09-27 17:16:24 +03:00
Joe Watkins 1981c48e60 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix CGI m4 config message when CGI is disabled
2017-09-27 06:20:34 +01:00
Peter Kokot 29e673f8ed Fix CGI m4 config message when CGI is disabled 2017-09-27 06:20:09 +01:00
Joe Watkins af71942da2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #75248 and #75251
2017-09-27 06:15:47 +01:00
Peter Kokot 6d0391b1a4 Fix bug #75248 and #75251 2017-09-27 06:15:12 +01:00
Joe Watkins 2dd77456fe Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #75220 - Segfault when calling is_callable on parent
2017-09-27 06:08:01 +01:00
Nester a680d701ce Fixed #75220 - Segfault when calling is_callable on parent 2017-09-27 06:07:24 +01:00
Anatol Belski 0217a81722 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Remove some old sapi/apache_hooks and sapi/apache leftovers
2017-09-25 21:58:18 +02:00
Peter Kokot 3752d18ffe Remove some old sapi/apache_hooks and sapi/apache leftovers 2017-09-25 21:56:39 +02:00
Dmitry Stogov 550595c085 Added missed ~ 2017-09-25 12:22:35 +03:00
Dmitry Stogov d526ddec85 Fixed type inference 2017-09-25 12:03:47 +03:00
Xinchen Hui 634f79d8d8 Update NEWS 2017-09-24 17:24:43 +08:00
Xinchen Hui e8c200515a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
  Compiler warning
2017-09-24 17:24:23 +08:00
Xinchen Hui b05ff14a9a Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()). 2017-09-24 17:24:11 +08:00
Xinchen Hui db63367871 Compiler warning 2017-09-24 17:19:05 +08:00
Nikita Popov 628c257f71 Merge branch 'PHP-7.0' into PHP-7.1 2017-09-24 08:54:36 +02:00
Nikita Popov 73d6456d7d Fixed bug #75252 2017-09-24 08:53:27 +02:00
Anatol Belski 96323d1bd7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix thread safety
2017-09-21 10:32:47 +02:00
Anatol Belski da2f581833 Fix thread safety 2017-09-21 10:32:09 +02:00
Andrea Faulds b71023e297 Merge branch 'PHP-7.0' into PHP-7.1 2017-09-21 00:04:08 +01:00
Andrea Faulds 418f97443a Fix bug #75236 2017-09-21 00:02:52 +01:00
Christoph M. Becker 0c0b955d5f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
2017-09-20 15:47:02 +02:00
Dmitry Stogov 9a01fe712a Fixed few ext/oci8 bugs 2017-09-20 16:46:04 +03:00
Christoph M. Becker eedc060c92 Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
We must not overwrite the SPL_DLLIST_IT_FIX flag when changing the
iterator mode.
2017-09-20 15:46:04 +02:00
Anatol Belski 5c59dd0047 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix the version check causing the test fail
2017-09-18 12:06:23 +02:00
Anatol Belski 9641586efa Fix the version check causing the test fail 2017-09-18 12:04:31 +02:00
Anatol Belski e3e3d37fa9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Update lib_versions.txt
2017-09-18 09:36:29 +02:00
Anatol Belski 7670590efd Update lib_versions.txt 2017-09-18 09:34:58 +02:00
Anatol Belski 351f98f5f3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Move to next binary SDK version for AppVeyor
2017-09-15 23:05:25 +02:00
Anatol Belski 7910c1dee9 Move to next binary SDK version for AppVeyor 2017-09-15 23:04:15 +02:00
Anatol Belski fba792945e [ci skip] update NEWS
Fix format
2017-09-13 15:46:33 +02:00
Anatol Belski 3d93856c4a Fixed bug #75018, fixed bug #75177
Both are caused by the same cast issue in mysqlnd on 32-bit.
2017-09-13 14:10:30 +02:00
Dmitry Stogov c24b3eff11 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Properly update string type flags
2017-09-13 01:46:12 +03:00
Dmitry Stogov d7a10f0e32 Properly update string type flags 2017-09-13 01:45:57 +03:00
Dmitry Stogov 5f1d553e7e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "Properly update string type flags"
2017-09-13 00:15:08 +03:00
Dmitry Stogov 83d8ebc991 Revert "Properly update string type flags"
This reverts commit 99b1a62d55.
2017-09-13 00:14:39 +03:00
Dmitry Stogov 253d49369d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed test
2017-09-12 23:47:39 +03:00
Dmitry Stogov 2874fa8fb0 Fixed test 2017-09-12 23:47:22 +03:00
Dmitry Stogov 7452fd0263 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Properly update string type flags
2017-09-12 23:43:42 +03:00
Dmitry Stogov 99b1a62d55 Properly update string type flags 2017-09-12 23:42:51 +03:00
Anatol Belski fcad6a97b8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix test failure on 32-bit
2017-09-12 18:18:44 +02:00
Anatol Belski 7674b5e574 Fix test failure on 32-bit 2017-09-12 18:17:28 +02:00
Joe Watkins 7f01872a24 bump versions 2017-09-12 15:34:30 +01:00
60 changed files with 1933 additions and 1250 deletions

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.10
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.11
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
-4
View File
@@ -15,11 +15,8 @@ ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
ext/zip/php_zip.c ident
README.input_filter ident
run-tests.php ident
sapi/nsapi/nsapi.c ident
sapi/continuity/capi.c ident
Zend/RFCs/002.txt ident
Zend/RFCs/003.txt ident
ext/exif/exif.c ident
@@ -32,7 +29,6 @@ UPGRADING.INTERNALS merge=NEWS
/ext/bz2/tests/with_strings.phpt -crlf
/ext/dom/tests/bug40836.phpt -crlf
/ext/dom/tests/domelement.phpt -crlf
/ext/ereg/tests/eregi_basic_002.phpt -crlf
/ext/iconv/tests/iconv004.phpt -crlf
/ext/iconv/tests/iconv_basic.phpt -crlf
/ext/iconv/tests/iconv_strpos.phpt -crlf
-2
View File
@@ -262,9 +262,7 @@ pear/phpize
pear/run-tests
pear/php-config
pear/scripts
sapi/apache/libphp7.module
sapi/apache2handler/libphp7.module
sapi/apache_hooks/libphp7.module
sapi/cgi/php-cgi
sapi/cgi/php-cgi.1
sapi/cli/php.1
+4 -4
View File
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
all: $(all_targets)
all: $(all_targets)
@echo
@echo "Build complete."
@echo "Don't forget to run 'make test'."
@@ -112,13 +112,13 @@ test: all
clean:
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f php7.spec main/build-defs.h scripts/phpize
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
@@ -135,7 +135,7 @@ prof-gen:
prof-clean:
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
+56 -1
View File
@@ -1,6 +1,60 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.1.10
26 Oct 2017, PHP 7.1.11
- Core:
. Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
(Laruence)
. Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
. Fixed bug #75252 (Incorrect token formatting on two parse errors in one
request). (Nikita)
. Fixed bug #75220 (Segfault when calling is_callable on parent).
(andrewnester)
. Fixed bug #75290 (debug info of Closures of internal functions contain
garbage argument names). (Andrea)
- Date:
. Fixed bug #75055 (Out-Of-Bounds Read in timelib_meridian()). (Derick)
- Apache2Handler:
. Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
apache2handler). (mcarbonneaux)
- Hash:
. Fixed bug #75303 (sha3 hangs on bigendian). (Remi)
- Intl:
. Fixed bug #75318 (The parameter of UConverter::getAliases() is not
optional). (cmb)
- litespeed:
. Fixed bug #75248 (Binary directory doesn't get created when building
only litespeed SAPI). (petk)
. Fixed bug #75251 (Missing program prefix and suffix). (petk)
- mcrypt:
. Fixed bug #72535 (arcfour encryption stream filter crashes php). (Leigh)
- MySQLi:
. Fixed bug #75018 (Data corruption when reading fields of bit type). (Anatol)
- OCI8:
. Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
- Opcache
. Fixed bug #75255 (Request hangs and not finish). (Dmitry)
- PCRE:
. Fixed bug #75207 (applied upstream patch for CVE-2016-1283). (Anatol)
- PDO_mysql:
. Fixed bug #75177 (Type 'bit' is fetched as unexpected string). (Anatol)
- SPL:
. Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags).
(J. Jeising, cmb)
28 Sep 2017, PHP 7.1.10
- Core:
. Fixed bug #75042 (run-tests.php issues with EXTENSION block). (John Boehr)
@@ -51,6 +105,7 @@ PHP NEWS
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
. Fixed bug #74725 (html_errors=1 breaks unhandled exceptions). (Andrea)
. Fixed bug #75063 (Main CWD initialized with wrong codepage). (Anatol)
. Fixed bug #75349 (NAN comparison). (Sara)
- cURL:
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
--FILE--
<?php
function eh(){}
set_error_handler('eh');
$d->d = &$d + $d->d/=0;
var_dump($d);
?>
--EXPECT--
float(INF)
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #75252: Incorrect token formatting on two parse errors in one request
--FILE--
<?php
$code = <<<'CODE'
function test_missing_semicolon() : string {
$x = []
FOO
}
CODE;
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
?>
--EXPECT--
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #75290 (debug info of Closures of internal functions contain garbage argument names)
--FILE--
<?php
var_dump((new ReflectionFunction('sin'))->getClosure());
var_dump(function ($someThing) {});
?>
--EXPECT--
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$number"]=>
string(10) "<required>"
}
}
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$someThing"]=>
string(10) "<required>"
}
}
+2
View File
@@ -916,6 +916,8 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
/* this should be compatible with the standard zenderror */
ZEND_COLD void zenderror(const char *error) /* {{{ */
{
CG(parse_error) = 0;
if (EG(exception)) {
/* An exception was thrown in the lexer, don't throw another in the parser. */
return;
+6 -3
View File
@@ -3068,7 +3068,8 @@ get_function_via_handler:
(!fcc->function_handler->common.scope ||
!instanceof_function(ce_org, fcc->function_handler->common.scope))) {
if (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3240,7 +3241,8 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3327,7 +3329,8 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
+1 -1
View File
@@ -283,7 +283,7 @@ struct _zend_mm_chunk {
uint32_t free_pages; /* number of free pages */
uint32_t free_tail; /* number of free pages at the end of chunk */
uint32_t num;
char reserve[64 - (sizeof(void*) * 3 + sizeof(int) * 3)];
char reserve[64 - (sizeof(void*) * 3 + sizeof(uint32_t) * 3)];
zend_mm_heap heap_slot; /* used only in main chunk */
zend_mm_page_map free_map; /* 512 bits or 64 bytes */
zend_mm_page_info map[ZEND_MM_PAGES]; /* 2 KB = 512 * 4 */
+10 -3
View File
@@ -503,6 +503,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zval val;
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
HashTable *debug_info;
zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
*is_temp = 1;
@@ -535,9 +536,15 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zend_string *name;
zval info;
if (arg_info->name) {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
if (zstr_args) {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
} else {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
((zend_internal_arg_info*)arg_info)->name);
}
} else {
name = zend_strpprintf(0, "%s$param%d",
arg_info->pass_by_reference ? "&" : "",
+3 -1
View File
@@ -222,8 +222,10 @@ ZEND_API void ZEND_FASTCALL convert_scalar_to_number(zval *op) /* {{{ */
if (Z_TYPE(holder) == IS_LONG) { \
if (op == result) { \
zval_ptr_dtor(op); \
ZVAL_LONG(op, Z_LVAL(holder)); \
} else { \
(op) = &(holder); \
} \
(op) = &(holder); \
} \
break; \
} \
+4 -2
View File
@@ -167,8 +167,10 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=1
PHP_RELEASE_VERSION=10
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=11
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`
+1189 -1081
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -931,8 +931,8 @@ isoweek = year4 "-"? "W" weekofyear;
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
firstdayof = 'first day of';
lastdayof = 'last day of';
backof = 'back of ' hour24 space? meridian?;
frontof = 'front of ' hour24 space? meridian?;
backof = 'back of ' hour24 (space? meridian)?;
frontof = 'front of ' hour24 (space? meridian)?;
/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
+36 -1
View File
@@ -658,6 +658,7 @@ static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot);
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
@@ -2129,7 +2130,7 @@ static void date_register_classes(void) /* {{{ */
date_object_handlers_interval.read_property = date_interval_read_property;
date_object_handlers_interval.write_property = date_interval_write_property;
date_object_handlers_interval.get_properties = date_object_get_properties_interval;
date_object_handlers_interval.get_property_ptr_ptr = NULL;
date_object_handlers_interval.get_property_ptr_ptr = date_interval_get_property_ptr_ptr;
date_object_handlers_interval.get_gc = date_object_get_gc_interval;
INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period);
@@ -4215,6 +4216,40 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
}
/* }}} */
/* {{{ date_interval_get_property_ptr_ptr */
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
{
zval tmp_member, *ret;
if (Z_TYPE_P(member) != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
cache_slot = NULL;
}
if(zend_binary_strcmp("y", sizeof("y") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("m", sizeof("m") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("d", sizeof("d") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("h", sizeof("h") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("i", sizeof("i") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("s", sizeof("s") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("days", sizeof("days") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("invert", sizeof("invert") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) {
/* Fallback to read_property. */
ret = NULL;
} else {
ret = (zend_get_std_object_handlers())->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
zval_dtor(member);
}
return ret;
}
/* }}} */
/* {{{ proto DateInterval::__construct([string interval_spec])
Creates new DateInterval object.
+1 -1
View File
@@ -40,7 +40,7 @@ object(DateInterval)#%d (16) {
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(9)
int(0)
["have_special_relative"]=>
int(0)
["f"]=>
@@ -0,0 +1,16 @@
--TEST--
Test DateInterval props with dimension handling
--FILE--
<?php
class Z extends DateInterval{}
$z = new Z('P2Y4DT6H8M');
$i = 0;
$z->prop[1]=10;
while ($i < 1026) {
$z->prop[$i] = $i;
$i++;
}
?>
==NOCRASH==
--EXPECT--
==NOCRASH==
+1 -1
View File
@@ -39,7 +39,7 @@ static inline unsigned char idx(unsigned char x, unsigned char y) {
#ifdef WORDS_BIGENDIAN
static inline uint64_t load64(const unsigned char* x) {
char i;
signed char i;
uint64_t ret = 0;
for (i = 7; i >= 0; --i) {
ret <<= 8;
+1 -1
View File
@@ -897,7 +897,7 @@ static PHP_METHOD(UConverter, getAvailable) {
/* }}} */
/* {{{ proto array UConverter::getAliases(string name) */
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 0)
ZEND_BEGIN_ARG_INFO_EX(php_converter_getaliases_arginfo, 0, ZEND_RETURN_VALUE, 1)
ZEND_ARG_INFO(0, name)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getAliases) {
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #75318 (The parameter of UConverter::getAliases() is not optional)
--SKIP--
<?php
if (!extension_loaded('intl')) die('skip intl extension is not available');
?>
--FILE--
<?php
$rm = new ReflectionMethod('UConverter', 'getAliases');
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(1)
===DONE===
+1 -1
View File
@@ -89,7 +89,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
php_stream_bucket_delref(bucket);
} else {
/* Stream cipher */
php_stream_bucket_make_writeable(bucket);
bucket = php_stream_bucket_make_writeable(bucket);
if (data->encrypt) {
mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
} else {
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #72535 arcfour encryption stream filter crashes php
--SKIPIF--
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
--FILE--
<?php
$passphrase = 'My secret';
$plaintext = 'Secret secret secret data';
$iv = substr(md5('iv' . $passphrase, true), 0, 8);
$key = substr(md5('pass1' . $passphrase, true) .
md5('pass2' . $passphrase, true), 0, 24);
$opts = array('iv' => $iv, 'key' => $key, 'mode' => 'stream');
$expected = substr($plaintext . $plaintext, 0, 48);
$fp = fopen('php://memory', 'wb+');
stream_filter_append($fp, 'mcrypt.arcfour', STREAM_FILTER_WRITE, $opts);
fwrite($fp, $plaintext);
?>
==NOCRASH==
--EXPECTF--
Deprecated: stream_filter_append(): mcrypt and mdecrypt stream filters have been deprecated in %s on line %d
==NOCRASH==
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Bug #75018 Data corruption when reading fields of bit type
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once("connect.inc");
$mysqli = new mysqli("$host:$port", $user, $passwd, $db);
$tbl = "test_bug75018";
$sql = "DROP TABLE IF EXISTS $tbl";
$mysqli->query($sql);
$sql = "CREATE TABLE $tbl (bit_column_1 bit(16) NOT NULL) DEFAULT CHARSET=utf8";
$mysqli->query($sql);
$sql = "INSERT INTO $tbl (bit_column_1) VALUES (0)";
$mysqli->query($sql);
$sql = "INSERT INTO $tbl (bit_column_1) VALUES (0b10101010101)";
$mysqli->query($sql);
$sql = "SELECT bit_column_1 FROM $tbl";
$result = $mysqli->query($sql);
while ($row = $result->fetch_assoc()) {
var_dump($row['bit_column_1']);
}
?>
==DONE==
--EXPECT--
string(1) "0"
string(4) "1365"
==DONE==
+1 -1
View File
@@ -1761,7 +1761,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
if (Z_TYPE_P(current_field) == IS_LONG && !as_int_or_float) {
/* we are using the text protocol, so convert to string */
char tmp[22];
const size_t tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, Z_LVAL_P(current_field));
const size_t tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, (uint64_t) Z_LVAL_P(current_field));
ZVAL_STRINGL(current_field, tmp, tmp_len);
} else if (Z_TYPE_P(current_field) == IS_STRING) {
/* nothing to do here, as we want a string and ps_fetch_from_1_to_8_bytes() has given us one */
+6 -4
View File
@@ -1402,6 +1402,8 @@ void php_oci_define_hash_dtor(zval *data)
define->name = NULL;
}
zval_ptr_dtor(&define->val);
efree(define);
}
/* }}} */
@@ -1414,9 +1416,9 @@ void php_oci_bind_hash_dtor(zval *data)
{
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
if (!Z_ISUNDEF(bind->parameter)) {
zval_ptr_dtor(&bind->parameter);
ZVAL_UNDEF(&bind->parameter);
if (!Z_ISUNDEF(bind->val)) {
zval_ptr_dtor(&bind->val);
ZVAL_UNDEF(&bind->val);
}
if (bind->array.elements) {
@@ -2642,7 +2644,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
if (placeholder == NULL) {
placeholder = return_value;
} else {
zval_dtor(placeholder);
zval_ptr_dtor(placeholder);
}
array_init(placeholder);
+4 -4
View File
@@ -75,10 +75,10 @@ sb4 callback_fn(void *svchp, void *envhp, void *fo_ctx, ub4 fo_type, ub4 fo_even
ZVAL_NULL(&params[0]);
/* Cleanup */
zval_dtor(&retval);
zval_dtor(&params[0]);
zval_dtor(&params[1]);
zval_dtor(&params[2]);
zval_ptr_dtor(&retval);
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&params[1]);
zval_ptr_dtor(&params[2]);
return returnValue;
}
+5 -4
View File
@@ -117,7 +117,7 @@ PHP_FUNCTION(oci_define_by_name)
php_oci_define *define;
zend_string *zvtmp;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|l", &stmt, &name, &name_len, &var, &type) == FAILURE) {
return;
}
@@ -153,7 +153,8 @@ PHP_FUNCTION(oci_define_by_name)
define->name[name_len] = '\0';
define->name_len = (ub4) name_len;
define->type = (ub4) type;
define->zval = var;
ZEND_ASSERT(Z_ISREF_P(var));
ZVAL_COPY(&define->val, var);
RETURN_TRUE;
}
@@ -202,7 +203,7 @@ PHP_FUNCTION(oci_bind_array_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/l|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rszl|ll", &z_statement, &name, &name_len, &bind_var, &max_array_len, &max_item_len, &type) == FAILURE) {
return;
}
@@ -1439,7 +1440,7 @@ PHP_FUNCTION(oci_fetch_all)
PHP_OCI_ZVAL_TO_STATEMENT(z_statement, statement);
zval_dtor(array);
zval_ptr_dtor(array);
while (skip--) {
if (php_oci_statement_fetch(statement, nrows)) {
+85 -66
View File
@@ -364,8 +364,10 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows)
continue;
}
zval_dtor(column->define->zval);
php_oci_column_to_zval(column, column->define->zval, 0);
ZEND_ASSERT(Z_ISREF(column->define->val));
zval_ptr_dtor(Z_REFVAL(column->define->val));
ZVAL_NULL(Z_REFVAL(column->define->val));
php_oci_column_to_zval(column, Z_REFVAL(column->define->val), 0);
}
return 0;
@@ -910,10 +912,12 @@ void php_oci_statement_free(php_oci_statement *statement)
int php_oci_bind_pre_exec(zval *data, void *result)
{
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
zval *zv = &bind->val;
*(int *)result = 0;
if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
ZVAL_DEREF(zv);
if (Z_TYPE_P(zv) == IS_ARRAY) {
/* These checks are currently valid for oci_bind_by_name, not
* oci_bind_array_by_name. Also bind->type and
* bind->indicator are not used for oci_bind_array_by_name.
@@ -927,7 +931,7 @@ int php_oci_bind_pre_exec(zval *data, void *result)
case SQLT_CLOB:
case SQLT_BLOB:
case SQLT_RDD:
if (Z_TYPE_P(bind->zval) != IS_OBJECT) {
if (Z_TYPE_P(zv) != IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -943,14 +947,14 @@ int php_oci_bind_pre_exec(zval *data, void *result)
case SQLT_LBI:
case SQLT_BIN:
case SQLT_LNG:
if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) {
if (Z_TYPE_P(zv) == IS_RESOURCE || Z_TYPE_P(zv) == IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
break;
case SQLT_RSET:
if (Z_TYPE_P(bind->zval) != IS_RESOURCE) {
if (Z_TYPE_P(zv) != IS_RESOURCE) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
*(int *)result = 1;
}
@@ -971,30 +975,34 @@ int php_oci_bind_post_exec(zval *data)
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
php_oci_connection *connection = bind->parent_statement->connection;
sword errstatus;
zval *zv = &bind->val;
ZVAL_DEREF(zv);
if (bind->indicator == -1) { /* NULL */
zval *val = bind->zval;
if (Z_TYPE_P(val) == IS_STRING) {
*Z_STRVAL_P(val) = '\0'; /* XXX avoid warning in debug mode */
if (Z_TYPE_P(zv) == IS_STRING) {
*Z_STRVAL_P(zv) = '\0'; /* XXX avoid warning in debug mode */
}
zval_dtor(val);
ZVAL_NULL(val);
} else if (Z_TYPE_P(bind->zval) == IS_STRING
&& Z_STRLEN_P(bind->zval) > 0
&& Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') {
zval_ptr_dtor(zv);
ZVAL_NULL(zv);
} else if (Z_TYPE_P(zv) == IS_STRING
&& Z_STRLEN_P(zv) > 0
&& Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] != '\0') {
/* The post- PHP 5.3 feature for "interned" strings disallows
* their reallocation but (i) any IN binds either interned or
* not should already be null terminated and (ii) for OUT
* binds, php_oci_bind_out_callback() should have allocated a
* new string that we can modify here.
*/
Z_STR_P(bind->zval) = zend_string_extend(Z_STR_P(bind->zval), Z_STRLEN_P(bind->zval)+1, 0);
Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
} else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
SEPARATE_STRING(zv);
Z_STR_P(zv) = zend_string_extend(Z_STR_P(zv), Z_STRLEN_P(zv)+1, 0);
Z_STRVAL_P(zv)[ Z_STRLEN_P(zv) ] = '\0';
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
int i;
zval *entry = NULL;
HashTable *hash = HASH_OF(bind->zval);
HashTable *hash;
SEPARATE_ARRAY(zv);
hash = HASH_OF(zv);
zend_hash_internal_pointer_reset(hash);
switch (bind->array.type) {
@@ -1003,22 +1011,22 @@ int php_oci_bind_post_exec(zval *data)
case SQLT_LNG:
for (i = 0; i < (int) bind->array.current_length; i++) {
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_dtor(entry);
zval_ptr_dtor(entry);
ZVAL_LONG(entry, ((oci_phpsized_int *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_long(bind->zval, ((oci_phpsized_int *)(bind->array.elements))[i]);
add_next_index_long(zv, ((oci_phpsized_int *)(bind->array.elements))[i]);
}
}
break;
case SQLT_FLT:
for (i = 0; i < (int) bind->array.current_length; i++) {
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_dtor(entry);
zval_ptr_dtor(entry);
ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]);
add_next_index_double(zv, ((double *)(bind->array.elements))[i]);
}
}
break;
@@ -1031,7 +1039,7 @@ int php_oci_bind_post_exec(zval *data)
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
zval_dtor(entry);
zval_ptr_dtor(entry);
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
@@ -1047,10 +1055,10 @@ int php_oci_bind_post_exec(zval *data)
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
add_next_index_null(bind->zval);
add_next_index_null(zv);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
add_next_index_stringl(bind->zval, (char *)buff, buff_len);
add_next_index_stringl(zv, (char *)buff, buff_len);
}
}
}
@@ -1066,20 +1074,21 @@ int php_oci_bind_post_exec(zval *data)
/* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */
int curr_element_length = bind->array.element_lengths[i];
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
zval_dtor(entry);
zval_ptr_dtor(entry);
ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
zend_hash_move_forward(hash);
} else {
add_next_index_stringl(bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
add_next_index_stringl(zv, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
}
}
break;
}
} else if ((Z_TYPE_P(bind->zval) == IS_TRUE) || (Z_TYPE_P(bind->zval) == IS_FALSE)) {
if (Z_LVAL_P(bind->zval) == 0)
ZVAL_BOOL(bind->zval, FALSE);
else if (Z_LVAL_P(bind->zval) == 1)
ZVAL_BOOL(bind->zval, TRUE);
} else if ((Z_TYPE_P(zv) == IS_TRUE) || (Z_TYPE_P(zv) == IS_FALSE)) {
/* This convetrsion is done on purpose (ext/oci8 uses LVAL as a temorary value) */
if (Z_LVAL_P(zv) == 0)
ZVAL_BOOL(zv, FALSE);
else if (Z_LVAL_P(zv) == 1)
ZVAL_BOOL(zv, TRUE);
}
return 0;
@@ -1103,11 +1112,8 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
sword errstatus;
zval *param = NULL;
if (!Z_ISREF_P(var)) {
param = var;
} else {
param = Z_REFVAL_P(var);
}
ZEND_ASSERT(Z_ISREF_P(var));
param = Z_REFVAL_P(var);
switch (type) {
case SQLT_NTY:
@@ -1242,9 +1248,9 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) {
bindp = old_bind;
if (!Z_ISUNDEF(bindp->parameter)) {
zval_ptr_dtor(&bindp->parameter);
ZVAL_UNDEF(&bindp->parameter);
if (!Z_ISUNDEF(bindp->val)) {
zval_ptr_dtor(&bindp->val);
ZVAL_UNDEF(&bindp->val);
}
} else {
zend_string *zvtmp;
@@ -1254,9 +1260,6 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
zend_string_release(zvtmp);
}
/* Keep a copy of bound variable in the bind hash */
ZVAL_COPY(&bindp->parameter, var);
/* Make sure the minimum of value_sz is 1 to avoid ORA-3149
* when both in/out parameters are bound with empty strings
*/
@@ -1266,7 +1269,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
bindp->descriptor = oci_desc;
bindp->statement = oci_stmt;
bindp->parent_statement = statement;
bindp->zval = param;
ZVAL_COPY(&bindp->val, var);
bindp->type = type;
/* Storing max length set in OCIBindByName() to check it later in
* php_oci_bind_in_callback() function to avoid ORA-1406 error while
@@ -1360,11 +1363,14 @@ sb4 php_oci_bind_in_callback(
php_oci_bind *phpbind;
zval *val;
if (!(phpbind=(php_oci_bind *)ictxp) || !(val = phpbind->zval)) {
if (!(phpbind=(php_oci_bind *)ictxp) || Z_ISUNDEF(phpbind->val)) {
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return OCI_ERROR;
}
val = &phpbind->val;
ZVAL_DEREF(val);
if (Z_ISNULL_P(val)) {
/* we're going to insert a NULL column */
phpbind->indicator = -1;
@@ -1421,11 +1427,14 @@ sb4 php_oci_bind_out_callback(
zval *val;
sb4 retval = OCI_ERROR;
if (!(phpbind=(php_oci_bind *)octxp) || !(val = phpbind->zval)) {
if (!(phpbind=(php_oci_bind *)octxp) || Z_ISUNDEF(phpbind->val)) {
php_error_docref(NULL, E_WARNING, "Invalid phpbind pointer value");
return retval;
}
val = &phpbind->val;
ZVAL_DEREF(val);
if (Z_TYPE_P(val) == IS_RESOURCE) {
/* Processing for ref-cursor out binds */
if (phpbind->statement != NULL) {
@@ -1463,7 +1472,7 @@ sb4 php_oci_bind_out_callback(
retval = OCI_CONTINUE;
} else {
convert_to_string(val);
zval_dtor(val);
zval_ptr_dtor(val);
{
char *p = ecalloc(1, PHP_OCI_PIECE_SIZE);
@@ -1474,12 +1483,12 @@ sb4 php_oci_bind_out_callback(
Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(val) + 1);
/* XXX is this right? */
ZVAL_STRINGL(val, NULL, Z_STRLEN(phpbind->zval) + 1);
ZVAL_STRINGL(val, NULL, Z_STRLEN(val) + 1);
#endif
/* XXX we assume that zend-zval len has 4 bytes */
*alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
*bufpp = Z_STRVAL_P(phpbind->zval);
*alenpp = (ub4*) &Z_STRLEN_P(val);
*bufpp = Z_STRVAL_P(val);
*piecep = OCI_ONE_PIECE;
*rcodepp = &phpbind->retcode;
*indpp = &phpbind->indicator;
@@ -1527,10 +1536,10 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0);
if (!column) {
php_error_docref(NULL, E_WARNING, "Invalid column index \"" ZEND_LONG_FMT "\"", Z_LVAL(tmp));
zval_dtor(&tmp);
zval_ptr_dtor(&tmp);
return NULL;
}
zval_dtor(&tmp);
zval_ptr_dtor(&tmp);
}
return column;
}
@@ -1586,11 +1595,15 @@ int php_oci_statement_get_numrows(php_oci_statement *statement, ub4 *numrows)
Bind arrays to PL/SQL types */
int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t name_len, zval *var, zend_long max_table_length, zend_long maxlength, zend_long type)
{
php_oci_bind *bind, *bindp;
php_oci_bind *bind;
sword errstatus;
zend_string *zvtmp;
zval *val;
convert_to_array(var);
ZEND_ASSERT(Z_ISREF_P(var));
val = Z_REFVAL_P(var);
SEPARATE_ZVAL_NOREF(val);
convert_to_array(val);
if (maxlength < -1) {
php_error_docref(NULL, E_WARNING, "Invalid max length value (" ZEND_LONG_FMT ")", maxlength);
@@ -1601,11 +1614,11 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
case SQLT_NUM:
case SQLT_INT:
case SQLT_LNG:
bind = php_oci_bind_array_helper_number(var, max_table_length);
bind = php_oci_bind_array_helper_number(val, max_table_length);
break;
case SQLT_FLT:
bind = php_oci_bind_array_helper_double(var, max_table_length);
bind = php_oci_bind_array_helper_double(val, max_table_length);
break;
case SQLT_AFC:
@@ -1614,14 +1627,14 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
case SQLT_AVC:
case SQLT_STR:
case SQLT_LVC:
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(var)) == 0) {
if (maxlength == -1 && zend_hash_num_elements(Z_ARRVAL_P(val)) == 0) {
php_error_docref(NULL, E_WARNING, "You must provide max length value for empty arrays");
return 1;
}
bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength);
bind = php_oci_bind_array_helper_string(val, max_table_length, maxlength);
break;
case SQLT_ODT:
bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection);
bind = php_oci_bind_array_helper_date(val, max_table_length, statement->connection);
break;
default:
php_error_docref(NULL, E_WARNING, "Unknown or unsupported datatype given: " ZEND_LONG_FMT, type);
@@ -1638,7 +1651,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
bind->statement = NULL;
bind->parent_statement = statement;
bind->bind = NULL;
bind->zval = var;
ZVAL_COPY(&bind->val, var);
bind->array.type = type;
bind->indicator = 0; /* not used for array binds */
bind->type = 0; /* not used for array binds */
@@ -1677,6 +1690,8 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
efree(bind->array.indicators);
}
zval_ptr_dtor(&bind->val);
efree(bind);
statement->errcode = php_oci_error(statement->err, errstatus);
@@ -1690,7 +1705,7 @@ int php_oci_bind_array_by_name(php_oci_statement *statement, char *name, size_t
}
zvtmp = zend_string_init(name, name_len, 0);
bindp = zend_hash_update_ptr(statement->binds, zvtmp, bind);
zend_hash_update_ptr(statement->binds, zvtmp, bind);
zend_string_release(zvtmp);
statement->errcode = 0; /* retain backwards compat with OCI8 1.4 */
@@ -1707,6 +1722,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
if (maxlength == -1) {
@@ -1723,7 +1739,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
}
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text));
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
@@ -1780,10 +1796,11 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (oci_phpsized_int *)safe_emalloc(max_table_length, sizeof(oci_phpsized_int), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1820,10 +1837,11 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
HashTable *hash;
zval *entry;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1861,10 +1879,11 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
zval *entry;
sword errstatus;
SEPARATE_ARRAY(var); /* TODO: may be use new HashTable iteration and prevent inplace modification */
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
ZVAL_UNDEF(&bind->val);
bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
+1 -1
View File
@@ -43,7 +43,7 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.7"
#define PHP_OCI8_VERSION "2.1.8"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
+2 -3
View File
@@ -209,7 +209,7 @@ typedef struct {
/* {{{ php_oci_define */
typedef struct {
zval *zval; /* zval used in define */
zval val; /* zval used in define */
text *name; /* placeholder's name */
ub4 name_len; /* placeholder's name length */
ub4 type; /* define type */
@@ -244,8 +244,7 @@ typedef struct {
/* {{{ php_oci_bind */
typedef struct {
OCIBind *bind; /* bind handle */
zval *zval; /* value */
zval parameter; /* a copy of bound variable used for oci_bind_by_name */
zval val; /* value */
dvoid *descriptor; /* used for binding of LOBS etc */
OCIStmt *statement; /* used for binding REFCURSORs */
php_oci_statement *parent_statement; /* pointer to the parent statement */
+1 -1
View File
@@ -690,7 +690,7 @@ static void zend_dump_block_info(const zend_cfg *cfg, int n, uint32_t dump_flags
if (b->flags & ZEND_BB_KILL_VAR) {
fprintf(stderr, " kill_var");
}
if (!(dump_flags & ZEND_DUMP_HIDE_UNREACHABLE) & !(b->flags & ZEND_BB_REACHABLE)) {
if (!(dump_flags & ZEND_DUMP_HIDE_UNREACHABLE) && !(b->flags & ZEND_BB_REACHABLE)) {
fprintf(stderr, " unreachable");
}
if (b->flags & ZEND_BB_LOOP_HEADER) {
+12 -6
View File
@@ -1708,6 +1708,10 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
for (j = scc_var[scc]; j >= 0; j = next_scc_var[j]) {
if (!ssa->var_info[j].has_range) {
zend_inference_init_range(op_array, ssa, j, 1, ZEND_LONG_MIN, ZEND_LONG_MAX, 1);
} else if (ssa->vars[j].definition_phi &&
ssa->vars[j].definition_phi->pi < 0) {
/* narrowing Phi functions first */
zend_ssa_range_narrowing(op_array, ssa, j, scc);
}
zend_bitset_incl(worklist, j);
}
@@ -2331,12 +2335,14 @@ static int zend_update_type_info(const zend_op_array *op_array,
}
} else if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (opline->op1_type == IS_CV) {
if (orig & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
orig &= (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
orig |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
}
if (orig & MAY_BE_OBJECT) {
orig |= (MAY_BE_RC1|MAY_BE_RCN);
if (!(orig & MAY_BE_REF)) {
if (orig & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
orig &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
orig |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
}
if (orig & MAY_BE_OBJECT) {
orig |= (MAY_BE_RC1|MAY_BE_RCN);
}
}
UPDATE_SSA_TYPE(orig, ssa_ops[i].op1_def);
COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
+13
View File
@@ -1027,6 +1027,19 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
ZEND_SET_FUNC_INFO(call_graph.op_arrays[i], NULL);
}
ZEND_HASH_FOREACH_PTR(&script->class_table, ce) {
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, name, op_array) {
if (op_array->scope != ce) {
zend_op_array *orig_op_array;
if ((orig_op_array = zend_hash_find_ptr(&op_array->scope->function_table, name)) != NULL) {
HashTable *ht = op_array->static_variables;
*op_array = *orig_op_array;
op_array->static_variables = ht;
}
}
} ZEND_HASH_FOREACH_END();
} ZEND_HASH_FOREACH_END();
zend_arena_release(&ctx.arena, checkpoint);
} else
#endif
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75255 (Request hangs and not finish)
--FILE--
<?php
function generatePlanImage() {
if ($abc > 5) {
$abc = 5;
}
for ($row = 0; $row < $abc; $row++) {
for ($col = 0; $col < $numCols; $col++) {
getPossibleRatio($abc);
}
}
}
?>
DONE
--EXPECT--
DONE
+6 -1
View File
@@ -7272,7 +7272,12 @@ for (;; ptr++)
so far in order to get the number. If the name is not found, leave
the value of recno as 0 for a forward reference. */
else
/* This patch (removing "else") fixes a problem when a reference is
to multiple identically named nested groups from within the nest.
Once again, it is not the "proper" fix, and it results in an
over-allocation of memory. */
/* else */
{
ng = cd->named_groups;
for (i = 0; i < cd->names_found; i++, ng++)
+10
View File
@@ -0,0 +1,10 @@
--TEST--
CVE-2016-1283, see bug #75207
--FILE--
<?php
preg_match("/š(?:F?+(?:^(?(R)a+\"){99}-))(?J)(?'R'(?'R'<((?'RR'(?'R'\){97)?J)?J)(?'R'(?'R'\){99|(:(?|(?'R')(\k'R')|((?'R')))H'R'R)(H'R))))))/", "*b\dc");
?>
==DONE==
--EXPECTF--
Warning: preg_match(): Compilation failed: unmatched parentheses at offset %d in %s on line %d
==DONE==
+33
View File
@@ -0,0 +1,33 @@
--TEST--
PDO MySQL Bug #75177 Type 'bit' is fetched as unexpected string
--SKIPIF--
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$pdo = MySQLPDOTest::factory();
$tbl = "tbl_bug75177";
$pdo->query("DROP TABLE IF EXISTS $tbl");
$pdo->query("CREATE TABLE $tbl (`bit` bit(8)) ENGINE=InnoDB");
$pdo->query("INSERT INTO $tbl (`bit`) VALUES (1)");
$pdo->query("INSERT INTO $tbl (`bit`) VALUES (0b011)");
$pdo->query("INSERT INTO $tbl (`bit`) VALUES (0b01100)");
$ret = $pdo->query("SELECT * FROM $tbl")->fetchAll();
foreach ($ret as $i) {
var_dump($i["bit"]);
}
?>
==DONE==
--EXPECT--
string(1) "1"
string(1) "3"
string(2) "12"
==DONE==
+1 -1
View File
@@ -733,7 +733,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
return;
}
intern->flags = value & SPL_DLLIST_IT_MASK;
intern->flags = (value & SPL_DLLIST_IT_MASK) | (intern->flags & SPL_DLLIST_IT_FIX);
RETURN_LONG(intern->flags);
}
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
--FILE--
<?php
$q = new SplQueue();
try {
$q->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);
} catch (Exception $e) {
echo 'unexpected exception: ' . $e->getMessage() . "\n";
}
try {
$q->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);
} catch (Exception $e) {
echo 'expected exception: ' . $e->getMessage() . "\n";
}
?>
===DONE===
--EXPECTF--
expected exception: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen
===DONE===
+1 -1
View File
@@ -314,7 +314,7 @@ PHP_FUNCTION(stream_socket_get_name)
RETURN_FALSE;
}
if (!ZSTR_LEN(name)) {
if ((ZSTR_LEN(name) == 0) || (ZSTR_VAL(name)[0] == 0)) {
zend_string_release(name);
RETURN_FALSE;
}
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #75220 (is_callable crash for 'parent')
--FILE--
<?php
$a = new A();
$a->bar('foo');
class B {};
class A extends B
{
function bar($func)
{
var_dump('foo');
var_dump(is_callable('parent::foo'));
var_dump(is_callable(array('parent', 'foo')));
}
function __call($func, $args)
{
}
};
?>
--EXPECT--
string(3) "foo"
bool(false)
bool(false)
@@ -0,0 +1,60 @@
--TEST--
Mkdir with path length < 260 and > 248 has be a long path
--SKIPIF--
<?php
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
skip_if_not_win();
$start = realpath(dirname(__FILE__));
if (strlen($start) > 260 || strlen($start) > 248) {
die("skip the starting path length is unsuitable for this test");
}
?>
--FILE--
<?php
$p = "";
$s = str_repeat('a', 50);
$how_many = 32;
for ($i = 0; $i < $how_many; $i++) {
$p .= "$s\\";
}
$start = realpath(dirname(__FILE__));
if (strlen($start) <= 248) {
// create the exact length
$start = $start . "\\" . str_repeat('a', 251 - strlen($start) - 1);
}
var_dump($start);
$p = $start . "\\" . $p;
var_dump($p);
var_dump(mkdir($p, 0777, true));
var_dump(file_exists($p));
$p7 = $p . "hello.txt";
var_dump(file_put_contents($p7, "hello"));
var_dump(file_get_contents($p7));
// cleanup
unlink($p7);
for ($i = 0; $i < $how_many; $i++) {
$p0 = substr($p, 0, strlen($p) - $i*51);
rmdir($p0);
}
?>
===DONE===
--EXPECTF--
string(251) "%s"
string(1884) "%s"
bool(true)
bool(true)
int(5)
string(5) "hello"
===DONE===
+1 -1
View File
@@ -5,5 +5,5 @@ Bug #74103: heap-use-after-free when unserializing invalid array size
var_dump(unserialize('a:7:{i:0;i:04;s:1:"a";i:2;i:9617006;i:4;s:1:"a";i:4;s:1:"a";R:5;s:1:"7";R:3;s:1:"a";R:5;;s:18;}}'));
?>
--EXPECTF--
Notice: unserialize(): Error at offset 64 of 96 bytes in %s on line %d
Notice: unserialize(): Error at offset %d of %d bytes in %s on line %d
bool(false)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75055 Out-Of-Bounds Read in timelib_meridian()
--SKIPIF--
<?php if (!extension_loaded("wddx")) print "skip"; ?>
--FILE--
<?php
$file_str = dirname(__FILE__) . "/bug75055.wddx";
$wddx_str = file_get_contents($file_str);
print strlen($wddx_str) . " bytes read.\n";
var_dump(wddx_deserialize($wddx_str));
?>
--EXPECT--
323 bytes read.
array(1) {
["aDateTime"]=>
string(12) "frONt of 0 0"
}
+13
View File
@@ -0,0 +1,13 @@
<?xml version='1.0'?>
<!DOCTYPE wddxPacket SYSTEM 'wddx_0100.dtd'>
<wddxPacket version='1.0'>
<header/>
<data>
<struct>
<var name='aDateTime'>
<dateTime>frONt of 0 0</dateTime>
</var>
</struct>
</data>
</wddxPacket>
+32 -7
View File
@@ -92,6 +92,8 @@
#include "SAPI.h"
#include "rfc1867.h"
#include "ext/standard/html_tables.h"
#if HAVE_MMAP || defined(PHP_WIN32)
# if HAVE_UNISTD_H
# include <unistd.h>
@@ -124,6 +126,31 @@ PHPAPI int core_globals_id;
#define SAFE_FILENAME(f) ((f)?(f):"-")
static char *get_safe_charset_hint(void) {
ZEND_TLS char *lastHint = NULL;
ZEND_TLS char *lastCodeset = NULL;
char *hint = SG(default_charset);
size_t len = strlen(hint);
size_t i = 0;
if (lastHint == SG(default_charset)) {
return lastCodeset;
}
lastHint = hint;
lastCodeset = NULL;
for (i = 0; i < sizeof(charset_map)/sizeof(charset_map[0]); i++) {
if (len == charset_map[i].codeset_len
&& zend_binary_strcasecmp(hint, len, charset_map[i].codeset, len) == 0) {
lastCodeset = (char*)charset_map[i].codeset;
break;
}
}
return lastCodeset;
}
/* {{{ PHP_INI_MH
*/
static PHP_INI_MH(OnSetPrecision)
@@ -762,10 +789,10 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
buffer_len = (int)vspprintf(&buffer, 0, format, args);
if (PG(html_errors)) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, SG(default_charset));
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, get_safe_charset_hint());
/* Retry with substituting invalid chars on fail. */
if (!replace_buffer || ZSTR_LEN(replace_buffer) < 1) {
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, SG(default_charset));
replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT | ENT_HTML_SUBSTITUTE_ERRORS, get_safe_charset_hint());
}
efree(buffer);
@@ -832,7 +859,7 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
}
if (PG(html_errors)) {
replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, SG(default_charset));
replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, get_safe_charset_hint());
efree(origin);
origin = ZSTR_VAL(replace_origin);
}
@@ -1154,7 +1181,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
if (PG(html_errors)) {
if (type == E_ERROR || type == E_PARSE) {
zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, SG(default_charset));
zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, get_safe_charset_hint());
php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, ZSTR_VAL(buf), error_filename, error_lineno, STR_PRINT(append_string));
zend_string_free(buf);
} else {
@@ -1221,9 +1248,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
sapi_header_op(SAPI_HEADER_REPLACE, &ctr);
}
/* the parser would return 1 (failure), we can bail out nicely */
if (type == E_PARSE) {
CG(parse_error) = 0;
} else {
if (type != E_PARSE) {
/* restore memory limit */
zend_set_memory_limit(PG(memory_limit));
efree(buffer);
+4 -4
View File
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 1
#define PHP_RELEASE_VERSION 10
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.1.10-dev"
#define PHP_VERSION_ID 70110
#define PHP_RELEASE_VERSION 11
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.1.11"
#define PHP_VERSION_ID 70111
+2 -2
View File
@@ -128,7 +128,7 @@ static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, zval *zv,
if (new_per_dir_entry->status >= orig_per_dir_entry->status) {
/* use new entry */
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", hash_key->arKey, new_per_dir_entry->status, orig_per_dir_entry->status));
phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", ZSTR_VAL(hash_key->key), new_per_dir_entry->status, orig_per_dir_entry->status));
return 1;
} else {
return 0;
@@ -176,7 +176,7 @@ void apply_config(void *dummy)
php_dir_entry *data;
ZEND_HASH_FOREACH_STR_KEY_PTR(&d->config, str, data) {
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
phpapdebug((stderr, "APPLYING (%s)(%s)\n", ZSTR_VAL(str), data->value));
if (zend_alter_ini_entry_chars(str, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
+3 -3
View File
@@ -27,9 +27,9 @@ if test "$PHP_CGI" != "no"; then
AC_MSG_CHECKING([whether cross-process locking is required by accept()])
case "`uname -sr`" in
IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
IRIX\ 5.* | SunOS\ 5.* | UNIX_System_V\ 4.0)
AC_MSG_RESULT([yes])
AC_DEFINE([USE_LOCKING], [1],
AC_DEFINE([USE_LOCKING], [1],
[Define if cross-process locking is required by accept()])
;;
*)
@@ -74,5 +74,5 @@ if test "$PHP_CGI" != "no"; then
PHP_OUTPUT(sapi/cgi/php-cgi.1)
else
AC_MSG_RESULT(yes)
AC_MSG_RESULT(no)
fi
+1 -13
View File
@@ -20,19 +20,7 @@ if (shell_exec('PowerShell -Help') === NULL)
// Hence on Windows 8, we don't verify that the title is actually set by
// cli_set_process_title(). We're only making the API calls to ensure there are
// no warnings/errors.
$is_windows8_or_above = false;
$ps_output = shell_exec("PowerShell -NoProfile \"(Get-Host).UI.RawUI.WindowTitle\"");
if ($ps_output === null)
{
echo "Get-Host failed\n";
die();
}
$ps_output = trim($ps_output);
$end_title_windows8 = ": Windows PowerShell";
if (($ps_output == "Windows PowerShell") || (strlen($ps_output) > strlen($end_title_windows8) && substr($ps_output,-strlen($end_title_windows8)) === $end_title_windows8) || PHP_WINDOWS_VERSION_MAJOR >= 10)
$is_windows8_or_above = true;
$is_windows8_or_above = PHP_WINDOWS_VERSION_MAJOR >= 10 || PHP_WINDOWS_VERSION_MAJOR >= 6 && PHP_WINDOWS_VERSION_MINOR >= 2;
echo "*** Testing setting the process title ***\n";
+1 -1
View File
@@ -4,7 +4,7 @@
$Id$
(c) 2011 Jerome Loyet
The PHP License, version 3.01
This is sample real-time status page for FPM. You can change it to better feet your needs.
This is sample real-time status page for FPM. You can change it to better fit your needs.
-->
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+2 -2
View File
@@ -5,5 +5,5 @@ $(SAPI_LITESPEED_PATH): $(PHP_GLOBAL_OBJS) $(PHP_BINARY_OBJS) $(PHP_LITESPEED_OB
install-litespeed: $(SAPI_LITESPEED_PATH)
@echo "Installing PHP LiteSpeed binary: $(INSTALL_ROOT)$(bindir)/"
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp
@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)lsphp$(program_suffix)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75236: infinite loop when printing an error-message
--FILE--
<?php
ini_set('html_errors', true);
ini_set('default_charset', 'ISO-8859-2');
printf ("before getfilecontent\n");
file_get_contents ('no/suchfile');
printf ("after getfilecontent\n");
?>
--EXPECTF--
before getfilecontent
<br />
<b>Warning</b>: file_get_contents(no/suchfile): failed to open stream: No such file or directory in <b>%s</b> on line <b>7</b><br />
after getfilecontent
+6 -6
View File
@@ -2860,18 +2860,18 @@ function toolset_setup_project_tools()
RE2C = PATH_PROG('re2c');
if (RE2C) {
var intvers, intmin;
var pattern = /\./g;
RE2CVERS = probe_binary(RE2C, "version");
var RE2CVERS = probe_binary(RE2C, "version");
STDOUT.WriteLine(' Detected re2c version ' + RE2CVERS);
if (RE2CVERS.match(/^\d+.\d+$/)) {
RE2CVERS += ".0";
}
intvers = RE2CVERS.replace(pattern, '') - 0;
intmin = MINRE2C.replace(pattern, '') - 0;
var hm = RE2CVERS.match(/(\d+)\.(\d+)\.(\d+)/);
var nm = MINRE2C.match(/(\d+)\.(\d+)\.(\d+)/);
var intvers = (hm[1]-0)*10000 + (hm[2]-0)*100 + (hm[3]-0);
var intmin = (nm[1]-0)*10000 + (nm[2]-0)*100 + (nm[3]-0);
if (intvers < intmin) {
STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);
+2 -2
View File
@@ -11,6 +11,6 @@ libpng-1.6.29
libpq-9.6.2
libssh2-1.8.0
libtidy-5.4.0
libxslt-1.1.29
libxml-2.9.4
libxslt-1.1.30
libxml-2.9.5
openssl-1.0.2k
+13 -3
View File
@@ -21,24 +21,33 @@
#include <windows.h>
#include <sys/stat.h>
#include "ioutil.h"
PHPAPI key_t
ftok(const char *pathname, int proj_id)
{
HANDLE fh;
struct stat st;
struct _stat st;
BY_HANDLE_FILE_INFORMATION bhfi;
key_t ret;
PHP_WIN32_IOUTIL_INIT_W(pathname)
if (stat(pathname, &st) < 0) {
if (!pathw) {
return (key_t)-1;
}
if ((fh = CreateFile(pathname, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) {
if (_wstat(pathw, &st) < 0) {
PHP_WIN32_IOUTIL_CLEANUP_W()
return (key_t)-1;
}
if ((fh = CreateFileW(pathw, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) {
PHP_WIN32_IOUTIL_CLEANUP_W()
return (key_t)-1;
}
if (!GetFileInformationByHandle(fh, &bhfi)) {
PHP_WIN32_IOUTIL_CLEANUP_W()
CloseHandle(fh);
return (key_t)-1;
}
@@ -46,6 +55,7 @@ ftok(const char *pathname, int proj_id)
ret = (key_t) ((proj_id & 0xff) << 24 | (st.st_dev & 0xff) << 16 | ((bhfi.nFileIndexLow | (__int64)bhfi.nFileIndexHigh << 32) & 0xffff));
CloseHandle(fh);
PHP_WIN32_IOUTIL_CLEANUP_W()
return ret;
}
+28 -1
View File
@@ -306,10 +306,37 @@ PW32IO int php_win32_ioutil_mkdir_w(const wchar_t *path, mode_t mode)
PW32IO int php_win32_ioutil_mkdir(const char *path, mode_t mode)
{/*{{{*/
wchar_t *pathw = php_win32_ioutil_any_to_w(path);
size_t pathw_len = 0;
wchar_t *pathw = php_win32_ioutil_conv_any_to_w(path, 0, &pathw_len);
int ret = 0;
DWORD err = 0;
if (pathw_len < _MAX_PATH && pathw_len > _MAX_PATH - 12) {
/* Special case here. From the doc:
"When using an API to create a directory, the specified path cannot be
so long that you cannot append an 8.3 file name ..."
Thus, if the directory name length happens to be in this range, it
already needs to be a long path. The given path is already normalized
and prepared, need only to prefix it.
*/
wchar_t *tmp = (wchar_t *) malloc((pathw_len + PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW + 1) * sizeof(wchar_t));
if (!tmp) {
free(pathw);
SET_ERRNO_FROM_WIN32_CODE(ERROR_NOT_ENOUGH_MEMORY);
return -1;
}
memmove(tmp, PHP_WIN32_IOUTIL_LONG_PATH_PREFIXW, PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW * sizeof(wchar_t));
memmove(tmp+PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW, pathw, pathw_len * sizeof(wchar_t));
pathw_len += PHP_WIN32_IOUTIL_LONG_PATH_PREFIX_LENW;
tmp[pathw_len] = L'\0';
free(pathw);
pathw = tmp;
}
/* TODO extend with mode usage */
if (!pathw) {
SET_ERRNO_FROM_WIN32_CODE(ERROR_INVALID_PARAMETER);