Compare commits

...
73 Commits
Author SHA1 Message Date
Anatol Belski 42b8d368f8 fix typo 2017-05-09 13:36:02 +02:00
Anatol Belski a466f9bd7e set versions 2017-05-09 12:33:31 +02:00
Anatol Belski bdabd22def [ci skip] sync NEWS 2017-04-27 11:52:44 +02:00
Jakub Zelenka 09e819736a Do not add already added object to the internal OpenSSL table
This fixes OpenSSL 1.1 where adding object with OID that has been
already added causes an error - preventing of duplication.

(cherry picked from commit c0203c0ceb)
2017-04-27 11:49:24 +02:00
Anatol Belski 3b77751bb1 Revert "Detect invalid port in xp_socket parse ip address"
This reverts commit bab0b99f37.

(cherry picked from commit 09ef61e3ca)
2017-04-27 11:17:06 +02:00
Anatol Belski c070353420 Revert "Follow up patch regarding bug #74216, see bug #74429"
This reverts commit cda7dcf4ca.

(cherry picked from commit bf3e2dce7b)
2017-04-27 11:16:56 +02:00
Remi Collet 9e89e62148 rely on bundle config, instead of system one
(cherry picked from commit f639b64dca)
2017-04-26 15:03:54 +02:00
Anatol Belski ca51b12d3a skip the test on OpenSSL < 1.1 for now
(cherry picked from commit 8cfaea656c)
2017-04-26 15:03:39 +02:00
Anatol Belski 36f14d1265 set versions 2017-04-25 14:16:39 +02:00
Anatol Belski 6aac86ec29 [ci skip] update NEWS 2017-04-25 13:59:20 +02:00
Sara Golemon cda7dcf4ca Follow up patch regarding bug #74216, see bug #74429
While the case in bug #74429 is not documented and is only worky due to
an implementation bug, the strength seems to breach some real world
apps. Given this patch doesn't impact the initial security fix for
bug #74216, it is reasonable to let the apps keep working. As mentioned
in the ticket, this behavior is a subject to change in future versions
and should not be abused.
2017-04-25 12:52:48 +02:00
Anatol Belski 6afcd6c86a don't backup older deps after upgrades 2017-04-24 22:10:32 +02:00
Anatol Belski e969966468 update SDK version for AppVeyor 2017-04-24 22:08:45 +02:00
Jakub Zelenka 9fa347997a Fix bug #73833 (null character not allowed in openssl_pkey_get_private) 2017-04-24 17:11:36 +01:00
Anatol Belski f7b8322b14 Support also no,shared configure arg vals by default
This indirectly fixes bug #74398 where --with-extname is expected to be
configured shared with our default dependency package. With a non
default deps, it still can be enforced --with-extname=static
2017-04-24 15:46:22 +02:00
Jakub Zelenka dd36541f2c Add missing NEWS entries for 7.0.19 2017-04-23 21:03:35 +01:00
Anatol Belski f3c4e2f5bf extend zlib export required for the recent libpng 2017-04-23 21:33:14 +02:00
Jakub Zelenka 366b1640d0 Fix bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH key) 2017-04-23 20:30:14 +01:00
Anatol Belski 5d1fd66faf [ci skip] update NEWS 2017-04-22 22:39:59 +02:00
Anton Serbulov 793a8bd886 #74337 pointer returned by php_stream_fopen_tmpfile not validated in memory.c 2017-04-22 21:56:37 +02:00
Steve Walk 9b7f13cb1b Avoid exact floating point comparison 2017-04-20 06:42:20 +01:00
Alexander Ilyin 464742bd2a Update php_network.h
```
In file included from /usr/local/include/php/main/php_network.h:124:0,
                 from /var/www/html/php-ext-handlersocketi-0.0.1/hs_response.c:3:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^
```
2017-04-20 06:39:14 +01:00
Michael Heimpold 32c5b8efd6 ext/gettext: respect passed in library directory for all checks
A directory given to configure by --with-gettext=dir is only
used within the very first AC_CHECK_LIB. This is because the
temporary modified LDFLAGS variable is reset too early.

This results in functions not detected properly.

The original issue and patch was reported for OpenWrt/LEDE
distribution by @Dimazhan at:
https://github.com/openwrt/packages/issues/4250

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2017-04-17 08:11:40 +01:00
Craig Duncan 618d97962a Fixed bug #74080 Add datetime constant for RFC7231 2017-04-17 08:08:54 +01:00
Fabien Villepinte 7dc6b04f45 Fixed bug #74439 Wrong reflection on the Locale methods 2017-04-17 07:56:47 +01:00
Anatol Belski ce330ad8aa [ci skip] update NEWS 2017-04-16 14:54:37 +02:00
Anatol Belski ca543ff01c improve/fix error handling
GetLastError() should not be called, if the function didn't fail.
2017-04-15 19:32:04 +02:00
Anatol Belski 9719621e07 fix error handling 2017-04-15 18:19:33 +02:00
Nikita Popov e433c23b96 Improve accuracy of opline lineno information
If compile_var() was used instead of compile_expr() we did not
update the current lineno.
2017-04-15 18:15:24 +02:00
Nikita Popov 0beccc51f1 Fix compact_literals of INIT_METHOD_CALL with CONST op1 2017-04-15 12:35:09 +02:00
Johannes Schlüter 35a28fac51 Add support for MySQL 8's Unicode types 2017-04-14 16:30:10 +02:00
Fabien Villepinte f05d74feb8 Fixed bug #74433 Wrong reflection on the Normalizer methods 2017-04-13 13:21:05 +01:00
Remi Collet da41afeb48 NEWS 2017-04-13 07:10:37 +02:00
Fabien Villepinte bc4bb7882b Fixed bug #74416 Wrong reflection on DOMNode::cloneNode 2017-04-13 07:07:24 +02:00
Christopher Jones f4a41fe750 Fixed uninitialized data causing random crash (Dmitry) 2017-04-12 14:02:46 +10:00
Christopher Jones 28ddfbb892 Add missing NEWS 2017-04-12 13:23:19 +10:00
Anatol Belski 8bba2df2eb Fix misleading typo in identifiers 2017-04-11 13:48:04 +02:00
Joe Watkins b74b325aea fixed bug #74413 wrong reflection on SQLite3::enableExceptions 2017-04-11 12:14:25 +01:00
Xinchen Hui eb03f16442 Fixed bug #74408 (Endless loop bypassing execution time limit) 2017-04-11 18:46:16 +08:00
Anatol Belski dd17659b86 fix re2c version comparison 2017-04-11 11:03:24 +02:00
Matt Ficken 76c9b58431 Fix #74410 by calling WaitForMultipleObjects() instead of
MsgWaitForMultipleObjects()
2017-04-11 01:54:57 -07:00
Sebastian Bergmann 7cdf520319 Fix bug #74409 2017-04-11 08:27:17 +02:00
Nikita Popov 6e23f2bceb Forgot to commit test file... 2017-04-10 22:26:14 +02:00
Nikita Popov 6f950e83eb Fix JMPZ+JMP => NOP+JMP optimization 2017-04-10 22:09:34 +02:00
Joe Watkins 8c53c346d4 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fixed bug #74402 (segfault on random_bytes, bin2hex, openssl_seal)
2017-04-10 12:51:17 +01:00
Joe Watkins d9e2f80375 Fixed bug #74404 (wrong reflection on DateTimeZone::getTransitions) 2017-04-10 12:48:51 +01:00
Xinchen Hui 42e576ace2 Fixed bug #74402 (segfault on random_bytes, bin2hex, openssl_seal) 2017-04-10 19:02:50 +08:00
Joe Watkins e642375764 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fixed condition check
  Fixed issue #2466 Invalid integer constant expression error in php.h
2017-04-10 08:07:24 +01:00
Joe Watkins 60b68f19f0 Fixed bug #74400 (phpdbg comparing socket function to int) 2017-04-10 08:05:31 +01:00
Xinchen Hui 4bebcb84ad Fixed condition check 2017-04-10 14:47:24 +08:00
Xinchen Hui 66411ee62e Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  fix news
  Fix of Bug #74383: Wrong reflection on Phar::running
2017-04-10 14:41:29 +08:00
Xinchen Hui d2923ec1e5 Fixed issue #2466 Invalid integer constant expression error in php.h 2017-04-10 14:40:44 +08:00
Joe Watkins a93832f414 fix news 2017-04-10 06:44:20 +01:00
Mitch Hagstrand d9a05807d2 Fix of Bug #74383: Wrong reflection on Phar::running 2017-04-10 06:32:15 +01:00
Xinchen Hui 9c7cb2cdcd Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Add NEWS
  Resolve bug #74188 (undefined statics raising with ?? operator)
  Fixed bug #72071: Prevent Max-Age from being negative
  Update NEWS with OpenSSL 1.1.0 support info
  Add OpenSSL 1.1.0 support to PHP 7.0
2017-04-10 11:49:44 +08:00
Xinchen Hui 341ff7119f Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c) 2017-04-10 11:44:41 +08:00
Xinchen Hui a87ee7c57b Missed NEWS 2017-04-10 11:22:08 +08:00
Nikita Popov 75b83ec2fd Add NEWS 2017-04-09 15:52:37 +02:00
Thomas Punt 744c4a5592 Resolve bug #74188 (undefined statics raising with ?? operator) 2017-04-09 15:29:31 +02:00
Craig Duncan ba6561d3cc Fixed bug #72071: Prevent Max-Age from being negative 2017-04-09 13:14:40 +02:00
Jakub Zelenka 948ad747d7 Update NEWS with OpenSSL 1.1.0 support info 2017-04-07 19:27:25 +01:00
Jakub Zelenka cdc33251d2 Add OpenSSL 1.1.0 support to PHP 7.0 2017-04-07 19:21:33 +01:00
Yussuf Khalil 27120d4412 Fix invalid free of persistent results on error/connection loss in mysqlnd (bug 74376) 2017-04-05 20:57:03 +02:00
Anatol Belski 4ca3468e78 Revert "extend skip section"
This reverts commit 5136048064.

This is not needed anymore wrt dst handling fix
2017-04-04 16:21:23 +02:00
Anatol Belski feeb35e438 fix possible out of bounds buffer access 2017-04-03 15:20:32 +02:00
Martin Hujer 670041b60e Fix opcache.max_accelerated_files doc in php.ini
As stated in docs: https://secure.php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files, the maximum is now 1000000
> The maximum value is 100000 in PHP < 5.5.6, and 1000000 in later versions.
2017-04-02 01:05:26 +02:00
Moritz Fain 46d286574b Fixed bug #74341
Added support for ASN.1 UTCTime without seconds part (being 11 characters
long instead of 13).

Additionally, fixed incorrect handling of DST on systems without gmtoff.
2017-04-02 01:04:32 +02:00
Anatol Belski e0102f81aa update sdk version for appveyor 2017-03-31 01:42:46 +02:00
Joe Watkins ef3140e544 fix bug #74343 compile fails on solaris 11 with system libgd 2017-03-30 16:27:40 +01:00
Nikita Popov d6f70f0ee3 Disable block pass for large functions
(Backport of 7ea261685f to 7.0.)
2017-03-28 22:07:37 +02:00
Anatol Belski 5c93a31804 update NEWS 2017-03-28 13:12:27 +02:00
Anatol Belski ef8632c9dc Revert "Fixed bug #61471"
This reverts commit 80c8d84af3.
2017-03-28 13:06:38 +02:00
Anatol Belski ddad991c18 prepare next 2017-03-28 11:49:04 +02:00
92 changed files with 1642 additions and 638 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.0beta2
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.1
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
+75 -1
View File
@@ -1,6 +1,74 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2017 PHP 7.0.18
11 May 2017 PHP 7.0.19
- Core:
. Fixed bug #74188 (Null coalescing operator fails for undeclared static
class properties). (tpunt)
. Fixed bug #74408 (Endless loop bypassing execution time limit). (Laruence)
. Fixed bug #74410 (stream_select() is broken on Windows Nanoserver).
(Matt Ficken)
. Fixed bug #74337 (php-cgi.exe crash on facebook callback).
(Anton Serbulov)
. Patch for bug #74216 was reverted. (Anatol)
- Date:
. Fixed bug #74404 (Wrong reflection on DateTimeZone::getTransitions).
(krakjoe)
. Fixed bug #74080 (add constant for RFC7231 format datetime). (duncan3dc)
- DOM:
. Fixed bug #74416 (Wrong reflection on DOMNode::cloneNode).
(Remi, Fabien Villepinte)
- Fileinfo:
. Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c).
(Laruence)
- GD:
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
(krakjoe)
- intl:
. Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa)
. Fixed bug #74439 (wrong reflection for Locale methods). (villfa)
- MySQLi:
. Fixed bug #74432 (mysqli_connect adding ":3306" to $host if $port parameter
not given). (Anatol)
- MySQLnd:
. Added support for MySQL 8.0 types. (Johannes)
. Fixed bug #74376 (Invalid free of persistent results on error/connection
loss). (Yussuf Khalil)
- OpenSSL:
. Fixed bug #73833 (null character not allowed in openssl_pkey_get_private).
(Jakub Zelenka)
. Fixed bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH
key). (Jakub Zelenka)
. Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
seconds). (Moritz Fain)
. Added OpenSSL 1.1.0 support. (Jakub Zelenka)
- phar:
. Fixed bug #74383 (phar method parameters reflection correction).
(mhagstrand)
- Standard:
. Fixed bug #74409 (Reflection information for ini_get_all() is incomplete).
(Sebastian Bergmann)
. Fixed bug #72071 (setcookie allows max-age to be negative). (Craig Duncan)
- Streams:
. Fixed bug #74429 (Remote socket URI with unique persistence identifier
broken). (Sara)
- SQLite3:
. Fixed bug #74413 (incorrect reflection for SQLite3::enableExceptions).
(krakjoe)
13 Apr 2017 PHP 7.0.18
- Core:
. Fixed bug #73370 (falsely exits with "Out of Memory" when using
@@ -11,6 +79,9 @@ PHP NEWS
to `isfinite'). (Nikita)
. Fixed bug #74302 (yield fromLABEL is over-greedy). (Sara)
- Apache:
. Reverted patch for bug #61471, fixes bug #74318. (Anatol)
- Date:
. Fixed bug #72096 (Swatch time value incorrect for dates before 1970). (mcq8)
@@ -21,6 +92,9 @@ PHP NEWS
- iconv:
. Fixed bug #74230 (iconv fails to fail on surrogates). (Anatol)
- OCI8:
. Fixed uninitialized data causing random crash. (Dmitry)
- OpenSSL:
. Fixed bug #72333 (fwrite() on non-blocking SSL sockets doesn't work).
(Jakub Zelenka)
+2 -3
View File
@@ -671,7 +671,6 @@ TSRM_API int shmget(int key, int size, int flags)
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{
shm_pair *shm = shm_get(key, NULL);
int err;
if (!shm->segment) {
return (void*)-1;
@@ -679,8 +678,8 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
err = GetLastError();
if (err) {
if (NULL == shm->addr) {
int err = GetLastError();
/* Catch more errors */
if (ERROR_NOT_ENOUGH_MEMORY == err) {
_set_errno(ENOMEM);
+1 -1
View File
@@ -79,7 +79,7 @@ Stack trace:
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0)
#5 {main}
thrown in %sbug72101.php on line 61
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Fixes bug 74188 (undeclared static variables emit a warning with ?? operator)
--FILE--
<?php
abstract class Test
{
public static function get()
{
static::$a ?? true;
}
}
Test::get();
?>
--EXPECT--
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Bug #74408 (Endless loop bypassing execution time limit)
--INI--
error_reporting = E_ALL | E_DEPRECATED | E_STRICT
--FILE--
<?php
//php.ini: error_reporting = E_ALL | E_DEPRECATED | E_STRICT
class ErrorHandling {
public function error_handler($errno, $errstr, $errfile, $errline) {
$bla = new NonExistingClass2();
}
public function exception_handler(Error $e) {
echo "Caught, exception: " . $e->getMessage();
}
}
set_error_handler('ErrorHandling::error_handler');
set_exception_handler('ErrorHandling::exception_handler');
$blubb = new NonExistingClass();
?>
--EXPECTF--
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in Unknown on line 0
Fatal error: Uncaught Error: Class 'NonExistingClass2' not found in %sbug74408.php:%d
Stack trace:
#0 [internal function]: ErrorHandling::error_handler(8192, 'Non-static meth...', '%s', %d, Array)
#1 %sbug74408.php(%d): set_exception_handler('ErrorHandling::...')
#2 {main}
thrown in %sbug74408.php on line %d
+2
View File
@@ -7314,6 +7314,8 @@ void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */
void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
CG(zend_lineno) = zend_ast_get_lineno(ast);
switch (ast->kind) {
case ZEND_AST_VAR:
zend_compile_simple_var(result, ast, type, 0);
+9
View File
@@ -755,6 +755,15 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
zend_error(E_DEPRECATED, "%s", error);
efree(error);
if (UNEXPECTED(EG(exception))) {
if (callable_name) {
zend_string_release(callable_name);
}
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
}
zend_string_release(callable_name);
}
+1 -1
View File
@@ -380,7 +380,7 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
size_t len = strlen(path);
if (path[len-4] == '.') {
if (len >= 4 && path[len-4] == '.') {
if (_memicmp(path+len-3, "exe", 3) == 0 ||
_memicmp(path+len-3, "com", 3) == 0 ||
_memicmp(path+len-3, "bat", 3) == 0 ||
+21 -9
View File
@@ -1515,9 +1515,13 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
}
ZEND_VM_C_GOTO(fetch_var_return);
@@ -1539,15 +1543,19 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
}
ZEND_VM_C_GOTO(fetch_var_return);
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (OP1_TYPE != IS_CONST) {
zend_string_release(name);
@@ -1555,8 +1563,12 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
FREE_OP1();
HANDLE_EXCEPTION();
}
if (OP1_TYPE == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (OP1_TYPE == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
FREE_OP1();
+177 -69
View File
@@ -5007,9 +5007,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -5031,15 +5035,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -5047,8 +5055,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CONST == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -6963,9 +6975,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -6987,15 +7003,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -7003,8 +7023,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CONST == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -7469,9 +7493,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -7493,15 +7521,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -7509,8 +7541,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CONST == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -31389,9 +31425,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -31413,15 +31453,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -31429,8 +31473,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CV == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -33617,9 +33665,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -33641,15 +33693,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -33657,8 +33713,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CV == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -34565,9 +34625,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -34589,15 +34653,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -34605,8 +34673,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CV == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -41826,9 +41898,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -41850,15 +41926,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -41866,8 +41946,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
zval_ptr_dtor_nogc(free_op1);
@@ -42829,9 +42913,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -42853,15 +42941,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -42869,8 +42961,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
zval_ptr_dtor_nogc(free_op1);
@@ -43240,9 +43336,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -43264,15 +43364,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -43280,8 +43384,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
zval_ptr_dtor_nogc(free_op1);
+2 -4
View File
@@ -2337,15 +2337,13 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
dnl If pkg-config is found try using it
if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
if $PKG_CONFIG --atleast-version=1.1 openssl; then
AC_MSG_ERROR([OpenSSL version >= 1.1 is not supported.])
elif $PKG_CONFIG --atleast-version=0.9.8 openssl; then
if $PKG_CONFIG --atleast-version=0.9.8 openssl; then
found_openssl=yes
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
else
AC_MSG_ERROR([OpenSSL version >= 0.9.8 and < 1.1 required.])
AC_MSG_ERROR([OpenSSL version 0.9.8 or greater required.])
fi
if test -n "$OPENSSL_LIBS"; then
+1 -1
View File
@@ -19,7 +19,7 @@ set STABILITY=staging
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
rem SDK is cached, deps info is cached as well
echo Updating dependencies in %DEPS_DIR%
call phpsdk_deps --update --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
call phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
if %errorlevel% neq 0 exit /b 3
call buildconf.bat --force
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=18
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=19
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`
+1 -1
View File
@@ -1,4 +1,4 @@
#if PHP_WIN32
#ifdef PHP_WIN32
#include "../../../../main/config.w32.h"
#else
#include <php_config.h>
+8 -1
View File
@@ -339,7 +339,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1)
ZEND_ARG_INFO(0, timestamp_end)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_timezone_method_transitions_get, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_transitions_get, 0, 0, 0)
ZEND_ARG_INFO(0, timestamp_begin)
ZEND_ARG_INFO(0, timestamp_end)
ZEND_END_ARG_INFO()
@@ -764,6 +764,11 @@ PHP_RSHUTDOWN_FUNCTION(date)
*/
#define DATE_FORMAT_RFC1123 "D, d M Y H:i:s O"
/*
* RFC7231, Section 7.1.1: http://tools.ietf.org/html/rfc7231
*/
#define DATE_FORMAT_RFC7231 "D, d M Y H:i:s \\G\\M\\T"
/*
* RFC2822, Section 3.3: http://www.ietf.org/rfc/rfc2822.txt
* FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space
@@ -857,6 +862,7 @@ PHP_MINIT_FUNCTION(date)
REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC7231", DATE_FORMAT_RFC7231, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC3339", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC3339_EXTENDED", DATE_FORMAT_RFC3339_EXTENDED, CONST_CS | CONST_PERSISTENT);
@@ -2050,6 +2056,7 @@ static void date_register_classes(void) /* {{{ */
REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850);
REGISTER_DATE_CLASS_CONST_STRING("RFC1036", DATE_FORMAT_RFC1036);
REGISTER_DATE_CLASS_CONST_STRING("RFC1123", DATE_FORMAT_RFC1123);
REGISTER_DATE_CLASS_CONST_STRING("RFC7231", DATE_FORMAT_RFC7231);
REGISTER_DATE_CLASS_CONST_STRING("RFC2822", DATE_FORMAT_RFC2822);
REGISTER_DATE_CLASS_CONST_STRING("RFC3339", DATE_FORMAT_RFC3339);
REGISTER_DATE_CLASS_CONST_STRING("RFC3339_EXTENDED", DATE_FORMAT_RFC3339_EXTENDED);
+3 -1
View File
@@ -156,7 +156,7 @@ array(18) {
}
}
..and get names of all its class constants
array(12) {
array(13) {
["ATOM"]=>
string(13) "Y-m-d\TH:i:sP"
["COOKIE"]=>
@@ -171,6 +171,8 @@ array(12) {
string(16) "D, d M y H:i:s O"
["RFC1123"]=>
string(16) "D, d M Y H:i:s O"
["RFC7231"]=>
string(21) "D, d M Y H:i:s \G\M\T"
["RFC2822"]=>
string(16) "D, d M Y H:i:s O"
["RFC3339"]=>
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #74080 Provide an RFC7231 date time format
--FILE--
<?php
$date = mktime(17, 52, 13, 4, 30, 2016);
var_dump(date(\DateTime::RFC7231, $date));
?>
--EXPECTF--
string(29) "Sat, 30 Apr 2016 17:52:13 GMT"
+2 -2
View File
@@ -10,12 +10,12 @@ date.timezone=UTC
$location = timezone_location_get(new DateTimeZone("Europe/Oslo"));
var_dump($location);
?>
--EXPECT--
--EXPECTF--
array(4) {
["country_code"]=>
string(2) "NO"
["latitude"]=>
float(59.91666)
float(59.9166%d)
["longitude"]=>
float(10.75)
["comments"]=>
+1 -1
View File
@@ -49,7 +49,7 @@ ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_child_nodes, 0, 0, 0)
ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 0)
ZEND_ARG_INFO(0, deep)
ZEND_END_ARG_INFO();
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #74416 Wrong reflection on DOMNode::cloneNode
--SKIPIF--
<?php
require_once('skipif.inc');
if (!extension_loaded('reflection')) die('skip reflection extension not available');
?>
--FILE--
<?php
$rm = new ReflectionMethod(DOMNode::class, "cloneNode");
printf("%d\n%d\n", $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
foreach ($rm->getParameters() as $param) {
printf("Parameter #%d %s OPTIONAL\n", $param->getPosition(), $param->isOptional() ? "IS" : "IS NOT");
}
?>
===DONE===
--EXPECT--
1
0
Parameter #0 IS OPTIONAL
===DONE===
+93 -81
View File
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2016-01-25 11:31:21.473017702 +0800
+++ libmagic/apprentice.c 2016-01-25 11:41:58.210723599 +0800
--- libmagic.orig/apprentice.c 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/apprentice.c 2017-04-10 11:43:17.272811417 +0800
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -49,7 +49,18 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
#ifndef SSIZE_MAX
#define MAXMAGIC_SIZE ((ssize_t)0x7fffffff)
@@ -168,38 +173,7 @@
@@ -75,6 +80,10 @@
#endif
#endif
+#ifndef offsetof
+#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
+#endif
+
#ifndef MAP_FAILED
#define MAP_FAILED (void *) -1
#endif
@@ -168,38 +177,7 @@
{ NULL, 0, NULL }
};
@@ -89,7 +100,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
struct type_tbl_s {
const char name[16];
@@ -281,6 +255,10 @@
@@ -281,6 +259,10 @@
# undef XX
# undef XX_NULL
@@ -100,7 +111,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
private int
get_type(const struct type_tbl_s *tbl, const char *l, const char **t)
{
@@ -405,7 +383,7 @@
@@ -405,7 +387,7 @@
struct mlist *ml;
mlp->map = idx == 0 ? map : NULL;
@@ -109,7 +120,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return -1;
ml->map = NULL;
@@ -426,10 +404,8 @@
@@ -426,10 +408,8 @@
apprentice_1(struct magic_set *ms, const char *fn, int action)
{
struct magic_map *map;
@@ -120,7 +131,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (magicsize != FILE_MAGICSIZE) {
file_error(ms, 0, "magic element size %lu != %lu",
@@ -445,12 +421,13 @@
@@ -445,12 +425,13 @@
return apprentice_compile(ms, map, fn);
}
@@ -138,7 +149,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (map == NULL)
return -1;
}
@@ -458,7 +435,8 @@
@@ -458,7 +439,8 @@
for (i = 0; i < MAGIC_SETS; i++) {
if (add_mlist(ms->mlist[i], map, i) == -1) {
file_oomem(ms, sizeof(*ml));
@@ -148,7 +159,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
}
@@ -472,15 +450,6 @@
@@ -472,15 +454,6 @@
}
}
return 0;
@@ -164,7 +175,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
protected void
@@ -491,10 +460,16 @@
@@ -491,10 +464,16 @@
return;
for (i = 0; i < MAGIC_SETS; i++)
mlist_free(ms->mlist[i]);
@@ -185,7 +196,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
protected struct magic_set *
@@ -503,7 +478,7 @@
@@ -503,7 +482,7 @@
struct magic_set *ms;
size_t i, len;
@@ -194,7 +205,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(struct magic_set)))) == NULL)
return NULL;
@@ -515,7 +490,7 @@
@@ -515,7 +494,7 @@
ms->o.buf = ms->o.pbuf = NULL;
len = (ms->c.len = 10) * sizeof(*ms->c.li);
@@ -203,7 +214,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
goto free;
ms->event_flags = 0;
@@ -531,7 +506,7 @@
@@ -531,7 +510,7 @@
ms->elf_notes_max = FILE_ELF_NOTES_MAX;
return ms;
free:
@@ -212,7 +223,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
@@ -540,30 +515,26 @@
@@ -540,30 +519,26 @@
{
if (map == NULL)
return;
@@ -256,7 +267,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
mlist->next = mlist->prev = mlist;
@@ -582,61 +553,12 @@
@@ -582,61 +557,12 @@
for (ml = mlist->next; (next = ml->next) != NULL; ml = next) {
if (ml->map)
apprentice_unmap(ml->map);
@@ -319,7 +330,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
/* const char *fn: list of magic files and directories */
protected int
file_apprentice(struct magic_set *ms, const char *fn, int action)
@@ -648,12 +570,28 @@
@@ -648,12 +574,28 @@
if (ms->mlist[0] != NULL)
file_reset(ms);
@@ -349,7 +360,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, strlen(fn));
return -1;
}
@@ -666,7 +604,7 @@
@@ -666,7 +608,7 @@
mlist_free(ms->mlist[i]);
ms->mlist[i] = NULL;
}
@@ -358,7 +369,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return -1;
}
}
@@ -683,7 +621,7 @@
@@ -683,7 +625,7 @@
fn = p;
}
@@ -367,7 +378,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (errs == -1) {
for (i = 0; i < MAGIC_SETS; i++) {
@@ -1062,7 +1000,7 @@
@@ -1062,7 +1004,7 @@
mset[i].max += ALLOC_INCR;
if ((mp = CAST(struct magic_entry *,
@@ -376,7 +387,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
NULL) {
file_oomem(ms, sizeof(*mp) * mset[i].max);
return -1;
@@ -1083,13 +1021,19 @@
@@ -1083,13 +1025,19 @@
load_1(struct magic_set *ms, int action, const char *fn, int *errs,
struct magic_entry_set *mset)
{
@@ -400,7 +411,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (errno != ENOENT)
file_error(ms, errno, "cannot read magic file `%s'",
fn);
@@ -1099,8 +1043,7 @@
@@ -1099,8 +1047,7 @@
memset(&me, 0, sizeof(me));
/* read and parse this file */
@@ -410,7 +421,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (len == 0) /* null line, garbage, etc */
continue;
if (line[len - 1] == '\n') {
@@ -1158,8 +1101,8 @@
@@ -1158,8 +1105,8 @@
}
if (me.mp)
(void)addentry(ms, &me, mset);
@@ -421,7 +432,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
/*
@@ -1238,7 +1181,7 @@
@@ -1238,7 +1185,7 @@
mentrycount += me[i].cont_count;
slen = sizeof(**ma) * mentrycount;
@@ -430,7 +441,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, slen);
return -1;
}
@@ -1260,8 +1203,8 @@
@@ -1260,8 +1207,8 @@
if (me == NULL)
return;
for (i = 0; i < nme; i++)
@@ -441,7 +452,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
private struct magic_map *
@@ -1270,18 +1213,19 @@
@@ -1270,18 +1217,19 @@
int errs = 0;
uint32_t i, j;
size_t files = 0, maxfiles = 0;
@@ -466,7 +477,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
file_oomem(ms, sizeof(*map));
return NULL;
@@ -1292,22 +1236,26 @@
@@ -1292,22 +1240,26 @@
(void)fprintf(stderr, "%s\n", usg_hdr);
/* load directory or file */
@@ -501,7 +512,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
continue;
}
if (files >= maxfiles) {
@@ -1315,23 +1263,22 @@
@@ -1315,23 +1267,22 @@
maxfiles = (maxfiles + 1) * 2;
mlen = maxfiles * sizeof(*filearr);
if ((filearr = CAST(char **,
@@ -531,7 +542,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
} else
load_1(ms, action, fn, &errs, mset);
if (errs)
@@ -1796,7 +1743,7 @@
@@ -1796,7 +1747,7 @@
if (me->cont_count == me->max_count) {
struct magic *nm;
size_t cnt = me->max_count + ALLOC_CHUNK;
@@ -540,7 +551,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(*nm) * cnt))) == NULL) {
file_oomem(ms, sizeof(*nm) * cnt);
return -1;
@@ -1811,7 +1758,7 @@
@@ -1811,7 +1762,7 @@
static const size_t len = sizeof(*m) * ALLOC_CHUNK;
if (me->mp != NULL)
return 1;
@@ -549,7 +560,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, len);
return -1;
}
@@ -1984,7 +1931,7 @@
@@ -1984,7 +1935,7 @@
m->type = get_standard_integer_type(l, &l);
else if (*l == 's' && !isalpha((unsigned char)l[1])) {
m->type = FILE_STRING;
@@ -558,7 +569,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
}
}
@@ -2005,7 +1952,7 @@
@@ -2005,7 +1956,7 @@
m->mask_op = 0;
if (*l == '~') {
@@ -567,7 +578,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->mask_op |= FILE_OPINVERSE;
else if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "'~' invalid for string types");
@@ -2014,7 +1961,7 @@
@@ -2014,7 +1965,7 @@
m->str_range = 0;
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
if ((op = get_op(*l)) != -1) {
@@ -576,7 +587,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
int r;
if (op != FILE_OPDIVIDE) {
@@ -2119,11 +2066,6 @@
@@ -2119,11 +2070,6 @@
if (check_format(ms, m) == -1)
return -1;
}
@@ -588,7 +599,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->mimetype[0] = '\0'; /* initialise MIME type to none */
return 0;
}
@@ -2195,7 +2137,7 @@
@@ -2195,7 +2141,7 @@
private int
parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line,
@@ -597,7 +608,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
size_t i;
const char *l = line;
@@ -2264,7 +2206,7 @@
@@ -2264,7 +2210,7 @@
struct magic *m = &me->mp[0];
return parse_extra(ms, me, line,
@@ -606,7 +617,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(m->mimetype), "MIME", "+-/.", 1);
}
@@ -2517,14 +2459,18 @@
@@ -2517,14 +2463,18 @@
return -1;
}
if (m->type == FILE_REGEX) {
@@ -632,7 +643,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
return 0;
case FILE_FLOAT:
@@ -2854,68 +2800,144 @@
@@ -2854,68 +2804,144 @@
private struct magic_map *
apprentice_map(struct magic_set *ms, const char *fn)
{
@@ -745,9 +756,10 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ file_error(ms, 0, "File %d.%d supports only version %d magic "
+ "files. `%s' is version %d", FILE_VERSION_MAJOR, patchlevel,
+ VERSIONNO, dbname, version);
+ goto error;
goto error;
+ }
+
- free(dbname);
+ /* php_magic_database is a const, performing writes will segfault. This is for big-endian
+ machines only, PPC and Sparc specifically. Consider static variable or MINIT in
+ future. */
@@ -780,13 +792,12 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ if (NULL != fn && entries != nentries + 1) {
+ file_error(ms, 0, "Inconsistent entries in `%s' %u != %u",
+ dbname, entries, nentries + 1);
goto error;
+ goto error;
+ }
+ if (needsbyteswap)
+ for (i = 0; i < MAGIC_SETS; i++)
+ byteswap(map->magic[i], map->nmagic[i]);
- free(dbname);
+
+ if (dbname) {
+ efree(dbname);
+ }
@@ -806,7 +817,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
@@ -2942,7 +2964,7 @@
@@ -2942,7 +2968,7 @@
version = ptr[1];
if (version != VERSIONNO) {
file_error(ms, 0, "File %s supports only version %d magic "
@@ -815,7 +826,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
VERSIONNO, dbname, version);
return -1;
}
@@ -2983,7 +3005,6 @@
@@ -2983,7 +3009,6 @@
{
static const size_t nm = sizeof(*map->nmagic) * MAGIC_SETS;
static const size_t m = sizeof(**map->magic);
@@ -823,7 +834,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
size_t len;
char *dbname;
int rv = -1;
@@ -2992,14 +3013,18 @@
@@ -2992,14 +3017,18 @@
struct magic m;
uint32_t h[2 + MAGIC_SETS];
} hdr;
@@ -846,7 +857,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_error(ms, errno, "cannot open `%s'", dbname);
goto out;
}
@@ -3008,24 +3033,25 @@
@@ -3008,24 +3037,25 @@
hdr.h[1] = VERSIONNO;
memcpy(hdr.h + 2, map->nmagic, nm);
@@ -877,7 +888,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return rv;
}
@@ -3059,16 +3085,18 @@
@@ -3059,16 +3089,18 @@
q++;
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
@@ -902,7 +913,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
/* Compatibility with old code that looked in .mime */
if (strstr(p, ".mime") != NULL)
@@ -3158,7 +3186,7 @@
@@ -3158,7 +3190,7 @@
m->offset = swap4((uint32_t)m->offset);
m->in_offset = swap4((uint32_t)m->in_offset);
m->lineno = swap4((uint32_t)m->lineno);
@@ -912,8 +923,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/ascmagic.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/ascmagic.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/ascmagic.c 2017-04-10 11:41:14.411268021 +0800
@@ -139,7 +139,7 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -934,8 +945,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2016-01-25 11:31:21.472017703 +0800
+++ libmagic/cdf.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/cdf.c 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/cdf.c 2017-04-10 11:41:14.411268021 +0800
@@ -35,7 +35,7 @@
#include "file.h"
@@ -1101,8 +1112,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
#ifdef CDF_DEBUG
else
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2016-01-25 11:31:21.493017704 +0800
+++ libmagic/cdf.h 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/cdf.h 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/cdf.h 2017-04-10 11:41:14.412268021 +0800
@@ -35,10 +35,12 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -1131,8 +1142,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2016-01-25 11:31:21.494017704 +0800
+++ libmagic/cdf_time.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/cdf_time.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/cdf_time.c 2017-04-10 11:41:14.412268021 +0800
@@ -96,7 +96,7 @@
}
@@ -1182,8 +1193,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL;
static const char *ref = "Sat Apr 23 01:30:00 1977";
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2016-01-25 11:31:21.483017704 +0800
+++ libmagic/compress.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/compress.c 2017-04-10 11:41:09.732268025 +0800
+++ libmagic/compress.c 2017-04-10 11:41:14.412268021 +0800
@@ -32,10 +32,11 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1382,8 +1393,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
--- libmagic.orig/elfclass.h 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/elfclass.h 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/elfclass.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/elfclass.h 2017-04-10 11:41:14.412268021 +0800
@@ -41,7 +41,7 @@
return toomany(ms, "program headers", phnum);
flags |= FLAGS_IS_CORE;
@@ -1412,8 +1423,8 @@ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
fsize, elf_getu16(swap, elfhdr.e_machine),
(int)elf_getu16(swap, elfhdr.e_shstrndx),
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2016-01-25 11:31:21.472017703 +0800
+++ libmagic/file.h 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/file.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/file.h 2017-04-10 11:41:14.412268021 +0800
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1633,8 +1644,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
#define __RCSID(a)
#endif
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/fsmagic.c 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/fsmagic.c 2017-04-10 11:41:09.730268025 +0800
+++ libmagic/fsmagic.c 2017-04-10 11:41:14.413268021 +0800
@@ -63,27 +63,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1985,8 +1996,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
return ret;
}
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2016-01-25 11:31:21.483017704 +0800
+++ libmagic/funcs.c 2016-01-25 11:41:34.164723619 +0800
--- libmagic.orig/funcs.c 2017-04-10 11:41:09.732268025 +0800
+++ libmagic/funcs.c 2017-04-10 11:41:14.413268021 +0800
@@ -31,7 +31,6 @@
#endif /* lint */
@@ -2217,7 +2228,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
{
@@ -403,8 +405,8 @@
if (level >= ms->c.len) {
len = (ms->c.len += 20) * sizeof(*ms->c.li);
len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
- malloc(len) :
- realloc(ms->c.li, len));
@@ -2370,9 +2381,10 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
return buf;
}
+
Common subdirectories: libmagic.orig/.libs and libmagic/.libs
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/magic.c 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/magic.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/magic.c 2017-04-10 11:41:14.413268021 +0800
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2761,8 +2773,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/magic.h 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/magic.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/magic.h 2017-04-10 11:41:14.413268021 +0800
@@ -88,6 +88,7 @@
const char *magic_getpath(const char *, int);
@@ -2780,8 +2792,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
int magic_errno(magic_t);
diff -u libmagic.orig/patchlevel.h libmagic/patchlevel.h
--- libmagic.orig/patchlevel.h 2016-01-25 11:31:21.473017702 +0800
+++ libmagic/patchlevel.h 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/patchlevel.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/patchlevel.h 2017-04-10 11:41:14.414268021 +0800
@@ -1,34 +1,43 @@
#define FILE_VERSION_MAJOR 5
-#define patchlevel 6
@@ -2846,8 +2858,8 @@ diff -u libmagic.orig/patchlevel.h libmagic/patchlevel.h
* Revision 1.69 2008/07/02 15:27:05 christos
* welcome to 4.25
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/print.c 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/print.c 2017-04-10 11:41:09.738268025 +0800
+++ libmagic/print.c 2017-04-10 11:41:14.414268021 +0800
@@ -28,13 +28,17 @@
/*
* print.c - debugging printout routines
@@ -3119,8 +3131,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
if (tm == NULL)
goto out;
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2016-01-25 11:31:21.493017704 +0800
+++ libmagic/readcdf.c 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/readcdf.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/readcdf.c 2017-04-10 11:41:14.414268021 +0800
@@ -26,15 +26,21 @@
#include "file.h"
@@ -3245,8 +3257,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
#ifdef CDF_DEBUG
cdf_dump_catalog(&h, &scn);
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/softmagic.c 2016-01-25 11:44:35.541684679 +0800
--- libmagic.orig/softmagic.c 2017-04-10 11:41:09.730268025 +0800
+++ libmagic/softmagic.c 2017-04-10 11:41:14.414268021 +0800
@@ -36,11 +36,19 @@
#endif /* lint */
@@ -3669,8 +3681,8 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
case FILE_INDIRECT:
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
--- libmagic.orig/strcasestr.c 2016-01-25 11:31:21.494017704 +0800
+++ libmagic/strcasestr.c 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/strcasestr.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/strcasestr.c 2017-04-10 11:41:14.415268021 +0800
@@ -39,6 +39,8 @@
#include "file.h"
+4
View File
@@ -80,6 +80,10 @@ FILE_RCSID("@(#)$File: apprentice.c,v 1.230 2015/01/02 21:29:39 christos Exp $")
#endif
#endif
#ifndef offsetof
#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
#endif
#ifndef MAP_FAILED
#define MAP_FAILED (void *) -1
#endif
+1 -1
View File
@@ -325,7 +325,7 @@ dnl Various checks for GD features
PHP_GD_FREETYPE2
dnl Header path
for i in include/gd include gd ""; do
for i in include/gd include/gd2 include gd ""; do
test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i"
done
+1 -1
View File
@@ -39,7 +39,7 @@
#include "php.h"
/* This just seems unessacary */
#if PHP_WIN32
#ifdef PHP_WIN32
#define ENABLE_GD_TTF
#else
#include <php_config.h>
+1 -1
View File
@@ -30,7 +30,6 @@ if test "$PHP_GETTEXT" != "no"; then
AC_MSG_ERROR(Unable to find required gettext library)
])
)
LDFLAGS=$O_LDFLAGS
AC_DEFINE(HAVE_LIBINTL,1,[ ])
PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared)
@@ -46,5 +45,6 @@ if test "$PHP_GETTEXT" != "no"; then
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])])
LDFLAGS=$O_LDFLAGS
fi
+34 -26
View File
@@ -38,26 +38,34 @@ zend_class_entry *Locale_ce_ptr = NULL;
ZEND_BEGIN_ARG_INFO_EX( locale_0_args, 0, 0, 0 )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_1_arg, 0, 0, 1 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_BEGIN_ARG_INFO_EX( locale_arg_locale, 0, 0, 1 )
ZEND_ARG_INFO( 0, locale )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_BEGIN_ARG_INFO_EX( locale_accept_from_http_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, header )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_3_args, 0, 0, 3 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_BEGIN_ARG_INFO_EX( locale_compose_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, subtags )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_4_args, 0, 0, 4 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_ARG_INFO( 0, arg4 )
ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, in_locale )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, langtag )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, canonicalize )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, langtag )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, canonicalize )
ZEND_ARG_INFO( 0, default )
ZEND_END_ARG_INFO()
/* }}} */
@@ -68,23 +76,23 @@ ZEND_END_ARG_INFO()
zend_function_entry Locale_class_functions[] = {
ZEND_FENTRY( getDefault, zif_locale_get_default , locale_0_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( setDefault, zif_locale_set_default , locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( setDefault, zif_locale_set_default , locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayScript, ZEND_FN( locale_get_display_script ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayRegion, ZEND_FN( locale_get_display_region ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayName, ZEND_FN( locale_get_display_name ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayLanguage, ZEND_FN( locale_get_display_language ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayVariant, ZEND_FN( locale_get_display_variant ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), locale_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), locale_4_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), locale_compose_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), locale_filter_matches_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), locale_lookup_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), locale_accept_from_http_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_FE_END
};
/* }}} */
+5 -6
View File
@@ -29,10 +29,9 @@ zend_class_entry *Normalizer_ce_ptr = NULL;
/* {{{ Normalizer methods arguments info */
ZEND_BEGIN_ARG_INFO_EX( normalizer_3_args, 0, 0, 3 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, input )
ZEND_ARG_INFO( 0, form )
ZEND_END_ARG_INFO()
/* }}} */
@@ -42,8 +41,8 @@ ZEND_END_ARG_INFO()
*/
zend_function_entry Normalizer_class_functions[] = {
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_FE_END
};
/* }}} */
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #74433 Wrong reflection on the Normalizer methods
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not available'); ?>
--FILE--
<?php
$rm = new ReflectionMethod(Normalizer::class, 'isNormalized');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
$rm = new ReflectionMethod(Normalizer::class, 'normalize');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(2)
int(1)
int(2)
int(1)
===DONE===
+54
View File
@@ -0,0 +1,54 @@
--TEST--
Bug #74439 Wrong reflection on the Locale methods
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not available'); ?>
--FILE--
<?php
$methods = [
'getDefault',
'acceptFromHttp',
'canonicalize',
'composeLocale',
'getAllVariants',
'getKeywords',
'getPrimaryLanguage',
'getRegion',
'getScript',
'parseLocale',
'setDefault',
'getDisplayLanguage',
'getDisplayName',
'getDisplayRegion',
'getDisplayScript',
'getDisplayVariant',
'filterMatches',
'lookup',
];
foreach ($methods as $method) {
$rm = new ReflectionMethod(Locale::class, $method);
printf("%s: %d, %d\n", $method, $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
}
?>
===DONE===
--EXPECT--
getDefault: 0, 0
acceptFromHttp: 1, 1
canonicalize: 1, 1
composeLocale: 1, 1
getAllVariants: 1, 1
getKeywords: 1, 1
getPrimaryLanguage: 1, 1
getRegion: 1, 1
getScript: 1, 1
parseLocale: 1, 1
setDefault: 1, 1
getDisplayLanguage: 2, 1
getDisplayName: 2, 1
getDisplayRegion: 2, 1
getDisplayScript: 2, 1
getDisplayVariant: 2, 1
filterMatches: 3, 2
lookup: 4, 2
===DONE===
+2 -2
View File
@@ -26,7 +26,7 @@
#if HAVE_LIBMCRYPT
#if PHP_WIN32
#ifdef PHP_WIN32
# include "win32/winutil.h"
#endif
@@ -1376,7 +1376,7 @@ PHP_FUNCTION(mcrypt_create_iv)
iv = ecalloc(size + 1, 1);
if (source == RANDOM || source == URANDOM) {
#if PHP_WIN32
#ifdef PHP_WIN32
/* random/urandom equivalent on Windows */
BYTE *iv_b = (BYTE *) iv;
if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){
+47
View File
@@ -688,6 +688,53 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 249, "gb18030", "gb18030_bin", 1, 4, "", mysqlnd_mbcharlen_gb18030, my_ismbchar_gb18030},
{ 254, UTF8_MB3, UTF8_MB3"_general_cs", 1, 3, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 255, UTF8_MB4, UTF8_MB4"_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 256, UTF8_MB4, UTF8_MB4"_de_pb_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 257, UTF8_MB4, UTF8_MB4"_is_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 258, UTF8_MB4, UTF8_MB4"_lv_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 259, UTF8_MB4, UTF8_MB4"_ro_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 260, UTF8_MB4, UTF8_MB4"_sl_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 261, UTF8_MB4, UTF8_MB4"_pl_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 262, UTF8_MB4, UTF8_MB4"_et_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 263, UTF8_MB4, UTF8_MB4"_es_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 264, UTF8_MB4, UTF8_MB4"_sv_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 265, UTF8_MB4, UTF8_MB4"_tr_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 266, UTF8_MB4, UTF8_MB4"_cs_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 267, UTF8_MB4, UTF8_MB4"_da_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 268, UTF8_MB4, UTF8_MB4"_lt_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 269, UTF8_MB4, UTF8_MB4"_sk_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 270, UTF8_MB4, UTF8_MB4"_es_trad_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 271, UTF8_MB4, UTF8_MB4"_la_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 272, UTF8_MB4, UTF8_MB4"_fa_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 273, UTF8_MB4, UTF8_MB4"_eo_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 274, UTF8_MB4, UTF8_MB4"_hu_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 275, UTF8_MB4, UTF8_MB4"_hr_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 276, UTF8_MB4, UTF8_MB4"_si_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 277, UTF8_MB4, UTF8_MB4"_vi_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 278, UTF8_MB4, UTF8_MB4"_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 279, UTF8_MB4, UTF8_MB4"_de_pb_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 280, UTF8_MB4, UTF8_MB4"_is_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 281, UTF8_MB4, UTF8_MB4"_lv_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 282, UTF8_MB4, UTF8_MB4"_ro_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 283, UTF8_MB4, UTF8_MB4"_sl_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 284, UTF8_MB4, UTF8_MB4"_pl_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 285, UTF8_MB4, UTF8_MB4"_et_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 286, UTF8_MB4, UTF8_MB4"_es_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 287, UTF8_MB4, UTF8_MB4"_sv_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 288, UTF8_MB4, UTF8_MB4"_tr_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 289, UTF8_MB4, UTF8_MB4"_cs_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 290, UTF8_MB4, UTF8_MB4"_da_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 291, UTF8_MB4, UTF8_MB4"_lt_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 292, UTF8_MB4, UTF8_MB4"_sk_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 293, UTF8_MB4, UTF8_MB4"_es_trad_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 294, UTF8_MB4, UTF8_MB4"_la_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 295, UTF8_MB4, UTF8_MB4"_fa_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 296, UTF8_MB4, UTF8_MB4"_eo_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 297, UTF8_MB4, UTF8_MB4"_hu_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 298, UTF8_MB4, UTF8_MB4"_hr_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 299, UTF8_MB4, UTF8_MB4"_si_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 300, UTF8_MB4, UTF8_MB4"_vi_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 303, UTF8_MB4, UTF8_MB4"_ja_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 0, NULL, NULL, 0, 0, NULL, NULL, NULL}
};
/* }}} */
+2 -2
View File
@@ -129,7 +129,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s)
} else {
COPY_CLIENT_ERROR(*conn->error_info, result->stored_data->error_info);
stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
mnd_pefree(stmt->result, stmt->result->persistent);
stmt->result = NULL;
stmt->state = MYSQLND_STMT_PREPARED;
}
@@ -356,7 +356,7 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s)
if (FAIL == (ret = PACKET_READ(fields_eof, stmt->conn))) {
if (stmt->result) {
stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
mnd_pefree(stmt->result, stmt->result->persistent);
memset(stmt, 0, sizeof(MYSQLND_STMT_DATA));
stmt->state = MYSQLND_STMT_INITTED;
}
+20 -4
View File
@@ -46,12 +46,12 @@ Interoperability Support" (ID 207303.1) for details.
<active>no</active>
</lead>
<date>2016-10-17</date>
<date>2017-04-12</date>
<time>12:00:00</time>
<version>
<release>2.1.3</release>
<api>2.1.3</api>
<release>2.1.4</release>
<api>2.1.4</api>
</version>
<stability>
<release>stable</release>
@@ -60,7 +60,7 @@ Interoperability Support" (ID 207303.1) for details.
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Fixed bug #71148 (Bind reference overwritten on PHP 7)
Fixed uninitialized data causing random crash
</notes>
<contents>
<dir name="/">
@@ -468,6 +468,22 @@ Fixed bug #71148 (Bind reference overwritten on PHP 7)
</extsrcrelease>
<changelog>
<release>
<version>
<release>2.1.3</release>
<api>2.1.3</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Fixed bug #71148 (Bind reference overwritten on PHP 7)
</notes>
</release>
<release>
<version>
<release>2.1.2</release>
+1 -1
View File
@@ -43,7 +43,7 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.3"
#define PHP_OCI8_VERSION "2.1.4"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
+7 -1
View File
@@ -1462,7 +1462,9 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
break;
}
}
if (last_op->op1_type & (IS_VAR|IS_TMP_VAR)) {
if (last_op->op1_type == IS_CV) {
break;
} else if (last_op->op1_type & (IS_VAR|IS_TMP_VAR)) {
last_op->opcode = ZEND_FREE;
last_op->op2.num = 0;
block->op2_to = NULL;
@@ -2000,6 +2002,10 @@ void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
return;
}
if ((uint64_t) op_array->last * (op_array->last_var + op_array->T) > 512 * 1024 * 1024) {
return;
}
/* Build CFG */
checkpoint = zend_arena_checkpoint(ctx->arena);
if (!find_code_blocks(op_array, &cfg, ctx)) {
+3
View File
@@ -146,6 +146,9 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
LITERAL_INFO(opline->op2.constant, LITERAL_FUNC, 1, 1, 3);
break;
case ZEND_INIT_METHOD_CALL:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
LITERAL_INFO(opline->op1.constant, LITERAL_VALUE, 1, 0, 1);
}
if (ZEND_OP2_TYPE(opline) == IS_CONST) {
optimizer_literal_obj_info(
info,
+8 -1
View File
@@ -156,7 +156,14 @@ void zend_optimizer_pass2(zend_op_array *op_array)
/* JMPNZ(X, L1), JMP(L2) => JMPZNZ(X, L2, L1) */
if (ZEND_OP2(opline).opline_num == ZEND_OP1(opline + 1).opline_num) {
/* JMPZ(X, L1), JMP(L1) => NOP, JMP(L1) */
MAKE_NOP(opline);
if (opline->op1_type == IS_CV) {
break;
} else if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
opline->opcode = ZEND_FREE;
opline->op2.num = 0;
} else {
MAKE_NOP(opline);
}
} else {
if (opline->opcode == ZEND_JMPZ) {
opline->extended_value = ZEND_OP1(opline + 1).opline_num;
+10 -9
View File
@@ -134,8 +134,8 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
FILE *fp = fopen(mmap_base_file, "r");
MEMORY_BASIC_INFORMATION info;
err = GetLastError();
if (!fp) {
err = GetLastError();
zend_win_error_message(ACCEL_LOG_WARNING, mmap_base_file, err);
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to open base address file", err);
*error_in="fopen";
@@ -184,9 +184,9 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
}
mapping_base = MapViewOfFileEx(memfile, FILE_MAP_ALL_ACCESS, 0, 0, 0, wanted_mapping_base);
err = GetLastError();
if (mapping_base == NULL) {
err = GetLastError();
if (err == ERROR_INVALID_ADDRESS) {
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to reattach to base address", err);
return ALLOC_FAILURE;
@@ -200,7 +200,7 @@ static int zend_shared_alloc_reattach(size_t requested_size, char **error_in)
static int create_segments(size_t requested_size, zend_shared_segment ***shared_segments_p, int *shared_segments_count, char **error_in)
{
int err, ret;
int err = 0, ret;
zend_shared_segment *shared_segment;
int map_retries = 0;
void *default_mapping_base_set[] = { 0, 0 };
@@ -222,14 +222,14 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
and we have to sleep some time (until the child releases the mapping object) and retry.*/
do {
memfile = OpenFileMapping(FILE_MAP_WRITE, 0, create_name_with_username(ACCEL_FILEMAP_NAME));
err = GetLastError();
if (memfile == NULL) {
err = GetLastError();
break;
}
ret = zend_shared_alloc_reattach(requested_size, error_in);
err = GetLastError();
if (ret == ALLOC_FAIL_MAPPING) {
err = GetLastError();
/* Mapping failed, wait for mapping object to get freed and retry */
CloseHandle(memfile);
memfile = NULL;
@@ -256,8 +256,9 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
*shared_segments_count = 1;
*shared_segments_p = (zend_shared_segment **) calloc(1, sizeof(zend_shared_segment)+sizeof(void *));
if (!*shared_segments_p) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_FATAL, "calloc() failed", GetLastError());
zend_win_error_message(ACCEL_LOG_FATAL, "calloc() failed", err);
*error_in = "calloc";
return ALLOC_FAILURE;
}
@@ -266,8 +267,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, requested_size,
create_name_with_username(ACCEL_FILEMAP_NAME));
err = GetLastError();
if (memfile == NULL) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to create file mapping", err);
*error_in = "CreateFileMapping";
@@ -301,8 +302,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
wanted_mapping_base++;
} while (!mapping_base);
err = GetLastError();
if (mapping_base == NULL) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to create view for file mapping", err);
*error_in = "MapViewOfFile";
@@ -310,8 +311,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
} else {
char *mmap_base_file = get_mmap_base_file();
FILE *fp = fopen(mmap_base_file, "w");
err = GetLastError();
if (!fp) {
err = GetLastError();
zend_shared_alloc_unlock_win32();
zend_win_error_message(ACCEL_LOG_WARNING, mmap_base_file, err);
zend_win_error_message(ACCEL_LOG_FATAL, "Unable to write base address", err);
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Edge-cases in elimination of JMPZ JMP with same target
--FILE--
<?php
$foo = "foo";
if ($foo . "bar") { goto label; }
label:
if ($undef) { goto label2; }
label2:
echo "done\n";
?>
--EXPECTF--
Notice: Undefined variable: undef in %s on line %d
done
@@ -0,0 +1,14 @@
--TEST--
Literal compaction should take method calls on literals into account
--FILE--
<?php
try {
(42)->foo();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Call to a member function foo() on integer
+1 -1
View File
@@ -1,7 +1,7 @@
// $Id$
// vim:ft=javascript
ARG_WITH("openssl", "OpenSSL support", "no");
ARG_WITH("openssl", "OpenSSL support", "no,shared");
if (PHP_OPENSSL != "no") {
if (CHECK_LIB("ssleay32.lib", "openssl", PHP_OPENSSL) &&
+587 -227
View File
File diff suppressed because it is too large. Load diff
+3 -2
View File
@@ -18,7 +18,8 @@ for ($z = "", $i = 0; $i < 1024; $i++) {
usleep($i);
}
$privkey = openssl_pkey_new();
$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf');
$privkey = openssl_pkey_new($conf);
if ($privkey === false)
die("failed to create private key");
@@ -30,7 +31,7 @@ if ($key_file_name === false)
echo "Export key to file\n";
openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase) or die("failed to export to file $key_file_name");
openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf) or die("failed to export to file $key_file_name");
echo "Load key from file - array syntax\n";
+3 -3
View File
@@ -10,14 +10,14 @@ if (OPENSSL_VERSION_NUMBER < 0x009070af) die("skip");
$prv = 'file://' . dirname(__FILE__) . '/' . 'bug41033.pem';
$pub = 'file://' . dirname(__FILE__) . '/' . 'bug41033pub.pem';
$alg = (OPENSSL_VERSION_NUMBER < 0x10000000) ? OPENSSL_ALGO_DSS1 : OPENSSL_ALGO_SHA1;
$prkeyid = openssl_get_privatekey($prv, "1234");
$ct = "Hello I am some text!";
openssl_sign($ct, $signature, $prkeyid, OPENSSL_ALGO_DSS1);
openssl_sign($ct, $signature, $prkeyid, $alg);
echo "Signature: ".base64_encode($signature) . "\n";
$pukeyid = openssl_get_publickey($pub);
$valid = openssl_verify($ct, $signature, $pukeyid, OPENSSL_ALGO_DSS1);
$valid = openssl_verify($ct, $signature, $pukeyid, $alg);
echo "Signature validity: " . $valid . "\n";
+2 -1
View File
@@ -16,7 +16,8 @@ AwEHoUQDQgAEPq4hbIWHvB51rdWr8ejrjWo4qVNWVugYFtPg/xLQw0mHkIPZ4DvK
sqOTOnMoezkbSmVVMuwz9flvnqHGmQvmug==
-----END EC PRIVATE KEY-----';
$key = openssl_pkey_get_private($pkey);
$res = openssl_sign($data ='alpha', $sign, $key, 'ecdsa-with-SHA1');
$sigalg = (OPENSSL_VERSION_NUMBER < 0x10000000) ? 'ecdsa-with-SHA1' : 'SHA1';
$res = openssl_sign($data ='alpha', $sign, $key, $sigalg);
var_dump($res);
--EXPECTF--
bool(true)
+3
View File
@@ -0,0 +1,3 @@
[ req ]
default_bits = 384
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #73711: Segfault in openssl_pkey_new when generating DSA or DH key
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
?>
--FILE--
<?php
$cnf = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug73711.cnf';
var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DSA, 'config' => $cnf]));
var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DH, 'config' => $cnf]));
echo "DONE";
?>
--EXPECTF--
resource(%d) of type (OpenSSL key)
resource(%d) of type (OpenSSL key)
DONE
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #73833: null character not allowed in openssl_pkey_get_private
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
?>
--FILE--
<?php
$passwords = ["abc\x00defghijkl", "abcdefghikjl"];
$conf = ['config' => __DIR__.'/openssl.cnf'];
foreach($passwords as $password) {
$key = openssl_pkey_new($conf);
if (openssl_pkey_export($key, $privatePEM, $password, $conf) === false) {
echo "Failed to encrypt.\n";
} else {
echo "Encrypted!\n";
}
if (openssl_pkey_get_private($privatePEM, $password) === false) {
echo "Failed to decrypt.\n";
} else {
echo "Decrypted!\n";
}
}
?>
--EXPECT--
Encrypted!
Decrypted!
Encrypted!
Decrypted!
+52
View File
@@ -0,0 +1,52 @@
--TEST--
Bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without seconds)
--SKIPIF--
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
$pem_cert = '
-----BEGIN CERTIFICATE-----
MIIGFDCCBPygAwIBAgIDKCHVMA0GCSqGSIb3DQEBBQUAMIHcMQswCQYDVQQGEwJV
UzEQMA4GA1UECBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTElMCMGA1UE
ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjE5MDcGA1UECxMwaHR0cDov
L2NlcnRpZmljYXRlcy5zdGFyZmllbGR0ZWNoLmNvbS9yZXBvc2l0b3J5MTEwLwYD
VQQDEyhTdGFyZmllbGQgU2VjdXJlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MREw
DwYDVQQFEwgxMDY4ODQzNTAcFwsxNDAxMDcwMDAwWhcNMTYwNDAxMDcwMDAwWjCB
6zETMBEGCysGAQQBgjc8AgEDEwJVUzEYMBYGCysGAQQBgjc8AgECEwdBcml6b25h
MR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjEUMBIGA1UEBRMLUi0xNzI0
NzQxLTYxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpT
Y290dHNkYWxlMSQwIgYDVQQKExtTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBMTEMx
KzApBgNVBAMTInZhbGlkLnNmaS5jYXRlc3Quc3RhcmZpZWxkdGVjaC5jb20wggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCt1LHQOza9tkKxwGL+/yKi/Fe5
HM0sjvcM4ic1XVrvpewa4P/04IzGSjIGO3CXaSArxQMSzsTt2dcO9tSJ1Zk8c9NZ
XM8eVqx92iTMEf9OQcubWpzWmrPc3TAFhbVnfEmCptsXEgtxbAIbntrNeDk/hBPd
l4DYFYRdm3ZTk4JMIf/quDZe5Oti53J0UsxWXSSoqKyPNdb671Q+OTQfSDj7kVF4
+Ri3FIeAV16d2UnpBW1bgNqA5yITRskHE4bX98HDNHUTHioHpgA+fXfejWkGB/0F
QN4HbZcysYHhf1L5cWBtz9w5J00YmjM5fzWvTc3UUF9ou7m7JE4aqEbNOWb9AgMB
AAGjggHOMIIByjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUE
FjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwLQYDVR0RBCYwJIIidmFsaWQuc2ZpLmNh
dGVzdC5zdGFyZmllbGR0ZWNoLmNvbTAdBgNVHQ4EFgQUcO+QEqZcHphPW9szww9t
y+1AGmQwHwYDVR0jBBgwFoAUSUtSJ9EbvPKhIWpie1FCeorX1VYwOAYDVR0fBDEw
LzAtoCugKYYnaHR0cDovL2NybC5zdGFyZmllbGR0ZWNoLmNvbS9zZnMzLTAuY3Js
MIGNBggrBgEFBQcBAQSBgDB+MCoGCCsGAQUFBzABhh5odHRwOi8vb2NzcC5zdGFy
ZmllbGR0ZWNoLmNvbS8wUAYIKwYBBQUHMAKGRGh0dHA6Ly9jZXJ0aWZpY2F0ZXMu
c3RhcmZpZWxkdGVjaC5jb20vcmVwb3NpdG9yeS9zZl9pbnRlcm1lZGlhdGUuY3J0
MFIGA1UdIARLMEkwRwYLYIZIAYb9bgEHFwMwODA2BggrBgEFBQcCARYqaHR0cDov
L2NlcnRzLnN0YXJmaWVsZHRlY2guY29tL3JlcG9zaXRvcnkvMA0GCSqGSIb3DQEB
BQUAA4IBAQAViYkLUjQkxWRmZl4DutL0/9/wJSURcJ1qunLP+TImJFp0A9RE/MNK
ZOmQoAEoH6hMg7FL4etkvTcnruTdcx+3mvqYiECUiUEx6pkx3dmkYgZACEuk2nfy
J0MkV/zwzqmI8aV+kunpOQv93aePZbrBgaAzkE8jDlExtd7c4pE7JF40jxmvDwjZ
HwpyNDULreGtFBij7JcWJCfihM3uetqrao0kOoeih1PQyJXtz2RldhFYs6Jdk3IL
Yv+84t5UMO+aS9nVBXIcbgaGjIMZjHDgR/tE9FKFB66k8UTDzAwwEs38VV24zx6h
lOzTF7xAUxmPUnNb2teatMf2Rmj0fs+d
-----END CERTIFICATE-----
';
$parsed_cert = openssl_x509_parse($pem_cert);
var_dump($parsed_cert['validFrom_time_t']);
var_dump($parsed_cert['validTo_time_t']);
?>
--EXPECTF--
int(1389052800)
int(1459494000)
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #74402 (segfault on random_bytes, bin3hex, openssl_seal)
--SKIPIF--
<?php
if (!extension_loaded("openssl")) {
print "skip";
}
if (!in_array('AES256', openssl_get_cipher_methods(true))) {
print "skip";
}
?>
--FILE--
<?php
$data = "23153b1cf683cb16f8d71190a7c42f38fecda27c29a7bc8991c9f6a2a63602bf";
$key = array("-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqvjCLfpS0MyilIjR+IsH
HPH8TqFUCw4kTAVmTy9SDZV9hHYY2EPgrlTd7gvMP/DWipvBD6Y5w2bPdAQoXr5D
qEKAGkE+1El4hS8XyuOdYXSYTDH1HPSlFiGdgsnlkFcbh/fJyzIKBaGLnWxsjhiS
deiI7KuEkI9zt+X2r4KqFt/dhnXz0kcB1M7qyhQ6Rvijgjy/A1LsN4ZAREFLCEjb
1AP9nk0QAUHWcG5MvbgsE20Pn4R5wFsMFBTvNmb34jHFREgR9j4DYcV5FFR3tKb8
3XtjE9/kjfK29BSpiyXZs8PSqDhO00vh6txUB4VfkVUD2Bi93rxDeyALnCW7My+l
YwIDAQAB
-----END PUBLIC KEY-----");
$iv = '';
var_dump(strlen($data));
var_dump(openssl_seal($data, $sealed_data, $env_keys, $key, 'AES256', $iv));
?>
--EXPECTF--
int(64)
int(80)
@@ -89,7 +89,7 @@ expect_openssl_errors('openssl_pkey_export_to_file opening', ['02001002', '2006D
expect_openssl_errors('openssl_pkey_export_to_file pem', ['0906D06C']);
// file to export cannot be written
@openssl_pkey_export_to_file($private_key_file, $invalid_file_for_write);
expect_openssl_errors('openssl_pkey_export_to_file write', ['2006D002', '09072007']);
expect_openssl_errors('openssl_pkey_export_to_file write', ['2006D002']);
// succesful export
@openssl_pkey_export($private_key_file_with_pass, $out, 'wrong pwd');
expect_openssl_errors('openssl_pkey_export', ['06065064', '0906A065']);
@@ -105,7 +105,7 @@ expect_openssl_errors('openssl_private_decrypt', ['04065072']);
// public encrypt and decrypt with failed padding check and padding
@openssl_public_encrypt("data", $crypted, $public_key_file, 1000);
@openssl_public_decrypt("data", $crypted, $public_key_file);
expect_openssl_errors('openssl_private_(en|de)crypt padding', ['0906D06C', '04068076', '0407006A', '04067072']);
expect_openssl_errors('openssl_private_(en|de)crypt padding', ['0906D06C', '04068076', '04067072']);
// X509
echo "X509 errors\n";
@@ -126,7 +126,7 @@ expect_openssl_errors('openssl_x509_checkpurpose purpose', ['0B086079']);
echo "CSR errors\n";
// file for csr (file:///) fails when opennig (BIO_new_file)
@openssl_csr_get_subject("file://" . $invalid_file_for_read);
expect_openssl_errors('openssl_csr_get_subject open', ['02001002', '2006D080', '20068079', '0906D06C']);
expect_openssl_errors('openssl_csr_get_subject open', ['02001002', '2006D080']);
// file or str csr is not correct PEM - failing PEM_read_bio_X509_REQ
@openssl_csr_get_subject($crt_file);
expect_openssl_errors('openssl_csr_get_subjec pem', ['0906D06C']);
+3 -2
View File
@@ -22,7 +22,8 @@ for ($z = "", $i = 0; $i < 1024; $i++) {
usleep($i);
}
$privkey = openssl_pkey_new();
$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf');
$privkey = openssl_pkey_new($conf);
if ($privkey === false)
die("failed to create private key");
@@ -34,7 +35,7 @@ if ($key_file_name === false)
echo "Export key to file\n";
openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase) or die("failed to export to file $key_file_name");
openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf) or die("failed to export to file $key_file_name");
echo "Load key from file - array syntax\n";
@@ -3,14 +3,6 @@ openssl_x509_parse() tests
--SKIPIF--
<?php if (!extension_loaded("openssl")) print "skip";
if (OPENSSL_VERSION_NUMBER < 0x10000000) die("skip Output requires OpenSSL 1.0");
if(substr(PHP_OS, 0, 3) == 'WIN') {
$exp = "W. Europe Standard Time";
$cmd = "powershell -command [System.TimeZoneInfo]::Local.Id";
$r = trim(shell_exec($cmd));
if ($exp !== $r) {
die("skip expect '$exp', got '$r'");
}
}
?>
--FILE--
<?php
+1
View File
@@ -3,6 +3,7 @@ sni_server
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (OPENSSL_VERSION_NUMBER >= 0x10100000) die("skip OpenSSL < v1.1.0 required");
--FILE--
<?php
$serverCode = <<<'CODE'
+21 -4
View File
@@ -996,6 +996,21 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
}
/* }}} */
#define PHP_SSL_MAX_VERSION_LEN 32
static char *php_ssl_cipher_get_version(const SSL_CIPHER *c, char *buffer, size_t max_len) /* {{{ */
{
const char *version = SSL_CIPHER_get_version(c);
strncpy(buffer, version, max_len);
if (max_len <= strlen(version)) {
buffer[max_len - 1] = 0;
}
return buffer;
}
/* }}} */
static int php_get_crypto_method_ctx_flags(int method_flags) /* {{{ */
{
int ssl_ctx_options = SSL_OP_ALL;
@@ -1210,7 +1225,7 @@ static int set_server_dh_param(php_stream * stream, SSL_CTX *ctx) /* {{{ */
/* }}} */
#endif
#ifdef HAVE_ECDH
#if defined(HAVE_ECDH) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER))
static int set_server_ecdh_curve(php_stream *stream, SSL_CTX *ctx) /* {{{ */
{
zval *zvcurve;
@@ -1253,7 +1268,7 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx) /* {{{ */
zval *zv;
long ssl_ctx_options = SSL_CTX_get_options(ctx);
#ifdef HAVE_ECDH
#if defined(HAVE_ECDH) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER))
if (set_server_ecdh_curve(stream, ctx) == FAILURE) {
return FAILURE;
}
@@ -1684,6 +1699,7 @@ static zend_array *capture_session_meta(SSL *ssl_handle) /* {{{ */
char *proto_str;
long proto = SSL_version(ssl_handle);
const SSL_CIPHER *cipher = SSL_get_current_cipher(ssl_handle);
char version_str[PHP_SSL_MAX_VERSION_LEN];
switch (proto) {
#ifdef HAVE_TLS12
@@ -1716,7 +1732,7 @@ static zend_array *capture_session_meta(SSL *ssl_handle) /* {{{ */
add_assoc_string(&meta_arr, "protocol", proto_str);
add_assoc_string(&meta_arr, "cipher_name", (char *) SSL_CIPHER_get_name(cipher));
add_assoc_long(&meta_arr, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL));
add_assoc_string(&meta_arr, "cipher_version", SSL_CIPHER_get_version(cipher));
add_assoc_string(&meta_arr, "cipher_version", php_ssl_cipher_get_version(cipher, version_str, PHP_SSL_MAX_VERSION_LEN));
return Z_ARR(meta_arr);
}
@@ -2292,6 +2308,7 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
if (sslsock->ssl_active) {
zval tmp;
char *proto_str;
char version_str[PHP_SSL_MAX_VERSION_LEN];
const SSL_CIPHER *cipher;
array_init(&tmp);
@@ -2318,7 +2335,7 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val
add_assoc_string(&tmp, "protocol", proto_str);
add_assoc_string(&tmp, "cipher_name", (char *) SSL_CIPHER_get_name(cipher));
add_assoc_long(&tmp, "cipher_bits", SSL_CIPHER_get_bits(cipher, NULL));
add_assoc_string(&tmp, "cipher_version", SSL_CIPHER_get_version(cipher));
add_assoc_string(&tmp, "cipher_version", php_ssl_cipher_get_version(cipher, version_str, PHP_SSL_MAX_VERSION_LEN));
#ifdef HAVE_TLS_ALPN
{
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #74376 (Invalid free of persistent results on error/connection loss)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
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');
$attr = getenv('PDOTEST_ATTR');
$attr = $attr ? unserialize($attr) : [];
$attr[PDO::ATTR_PERSISTENT] = true;
$attr[PDO::ATTR_EMULATE_PREPARES] = false;
putenv('PDOTEST_ATTR=' . serialize($attr));
$db = MySQLPDOTest::factory();
$stmt = $db->query("select (select 1 union select 2)");
print "ok";
?>
--EXPECTF--
ok
+1 -1
View File
@@ -5191,7 +5191,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_webPhar, 0, 0, 0)
ZEND_END_ARG_INFO()
PHAR_ARG_INFO
ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_running, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_running, 0, 0, 0)
ZEND_ARG_INFO(0, retphar)
ZEND_END_ARG_INFO()
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Phar: bug #74383: Wrong reflection on Phar::running
--SKIPIF--
<?php if (!extension_loaded("phar") || !extension_loaded('reflection')) die("skip"); ?>
--FILE--
<?php
$rc = new ReflectionClass(Phar::class);
$rm = $rc->getMethod("running");
echo $rm->getNumberOfParameters();
echo PHP_EOL;
echo $rm->getNumberOfRequiredParameters();
echo PHP_EOL;
echo (int) $rm->getParameters()[0]->isOptional();
?>
--EXPECT--
1
0
1
+7 -6
View File
@@ -1494,7 +1494,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
BIO *in;
EVP_PKEY *key;
EVP_MD *mdtype = (EVP_MD *) EVP_sha1();
EVP_MD_CTX md_ctx;
EVP_MD_CTX *md_ctx;
#else
int tempsig;
#endif
@@ -1567,7 +1567,8 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
EVP_VerifyInit(&md_ctx, mdtype);
md_ctx = EVP_MD_CTX_create();
EVP_VerifyInit(md_ctx, mdtype);
read_len = end_of_phar;
if (read_len > sizeof(buf)) {
@@ -1579,7 +1580,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
php_stream_seek(fp, 0, SEEK_SET);
while (read_size && (len = php_stream_read(fp, (char*)buf, read_size)) > 0) {
EVP_VerifyUpdate (&md_ctx, buf, len);
EVP_VerifyUpdate (md_ctx, buf, len);
read_len -= (zend_off_t)len;
if (read_len < read_size) {
@@ -1587,9 +1588,9 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
}
}
if (EVP_VerifyFinal(&md_ctx, (unsigned char *)sig, sig_len, key) != 1) {
if (EVP_VerifyFinal(md_ctx, (unsigned char *)sig, sig_len, key) != 1) {
/* 1: signature verified, 0: signature does not match, -1: failed signature operation */
EVP_MD_CTX_cleanup(&md_ctx);
EVP_MD_CTX_destroy(md_ctx);
if (error) {
spprintf(error, 0, "broken openssl signature");
@@ -1598,7 +1599,7 @@ int phar_verify_signature(php_stream *fp, size_t end_of_phar, php_uint32 sig_typ
return FAILURE;
}
EVP_MD_CTX_cleanup(&md_ctx);
EVP_MD_CTX_destroy(md_ctx);
#endif
*signature_len = phar_hex_str((const char*)sig, sig_len, signature);
+1 -1
View File
@@ -627,7 +627,7 @@ static int _php_source_op_to_ipv4_op(enum source_op sop)
#endif /* HAS_MCAST_EXT */
#if PHP_WIN32
#ifdef PHP_WIN32
int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
{
MIB_IPADDRTABLE *addr_table;
+4 -4
View File
@@ -1923,14 +1923,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_createcollation, 0, 0, 2)
ZEND_ARG_INFO(0, callback)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(argingo_sqlite3_openblob, 0, 0, 3)
ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_openblob, 0, 0, 3)
ZEND_ARG_INFO(0, table)
ZEND_ARG_INFO(0, column)
ZEND_ARG_INFO(0, rowid)
ZEND_ARG_INFO(0, dbname)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(argingo_sqlite3_enableexceptions, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_sqlite3_enableexceptions, 0, 0, 0)
ZEND_ARG_INFO(0, enableExceptions)
ZEND_END_ARG_INFO()
@@ -1987,8 +1987,8 @@ static zend_function_entry php_sqlite3_class_methods[] = {
PHP_ME(sqlite3, createFunction, arginfo_sqlite3_createfunction, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, createAggregate, arginfo_sqlite3_createaggregate, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, createCollation, arginfo_sqlite3_createcollation, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, openBlob, argingo_sqlite3_openblob, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, enableExceptions, argingo_sqlite3_enableexceptions, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, openBlob, arginfo_sqlite3_openblob, ZEND_ACC_PUBLIC)
PHP_ME(sqlite3, enableExceptions, arginfo_sqlite3_enableexceptions, ZEND_ACC_PUBLIC)
/* Aliases */
PHP_MALIAS(sqlite3, __construct, open, arginfo_sqlite3_open, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_FE_END
+1
View File
@@ -735,6 +735,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ini_get_all, 0, 0, 0)
ZEND_ARG_INFO(0, extension)
ZEND_ARG_INFO(0, details)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_ini_set, 0)
+1 -1
View File
@@ -3,7 +3,7 @@
#ifndef _CRYPT_FREESEC_H
#define _CRYPT_FREESEC_H
#if PHP_WIN32
#ifdef PHP_WIN32
# ifndef inline
# define inline __inline
# endif
+1 -1
View File
@@ -68,7 +68,7 @@ struct sha256_ctx {
char buffer[128]; /* NB: always correctly aligned for uint32_t. */
};
#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN))
#if defined(PHP_WIN32) || (!defined(WORDS_BIGENDIAN))
# define SWAP(n) \
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#else
+1 -1
View File
@@ -63,7 +63,7 @@ struct sha512_ctx
};
#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN))
#if defined(PHP_WIN32) || (!defined(WORDS_BIGENDIAN))
# define SWAP(n) \
(((n) << 56) \
| (((n) & 0xff00) << 40) \
+1 -1
View File
@@ -131,7 +131,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now)
/* load dynamic symbol */
handle = DL_LOAD(libpath);
if (!handle) {
#if PHP_WIN32
#ifdef PHP_WIN32
char *err = GET_DL_ERROR();
if (err && (*err != '\0')) {
php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, err);
+7 -1
View File
@@ -134,6 +134,8 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires,
if (expires > 0) {
const char *p;
char tsdelta[13];
double diff;
strlcat(cookie, COOKIE_EXPIRES, len + 100);
dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0);
/* check to make sure that the year does not exceed 4 digits in length */
@@ -148,7 +150,11 @@ PHPAPI int php_setcookie(zend_string *name, zend_string *value, time_t expires,
strlcat(cookie, ZSTR_VAL(dt), len + 100);
zend_string_free(dt);
snprintf(tsdelta, sizeof(tsdelta), ZEND_LONG_FMT, (zend_long) difftime(expires, time(NULL)));
diff = difftime(expires, time(NULL));
if (diff < 0) {
diff = 0;
}
snprintf(tsdelta, sizeof(tsdelta), ZEND_LONG_FMT, (zend_long) diff);
strlcat(cookie, COOKIE_MAX_AGE, len + 100);
strlcat(cookie, tsdelta, len + 100);
}
+1 -1
View File
@@ -39,7 +39,7 @@
*/
#include "php.h"
#if PHP_WIN32
#ifdef PHP_WIN32
#include "config.w32.h"
#else
#include <php_config.h>
+1 -1
View File
@@ -32,7 +32,7 @@
#include "info.h"
#include "php_random.h"
#if PHP_WIN32
#ifdef PHP_WIN32
#include "win32/winutil.h"
#endif
+2 -2
View File
@@ -37,7 +37,7 @@
#include <string.h>
#if PHP_WIN32
#ifdef PHP_WIN32
# include <windows.h>
# include <Wincrypt.h>
#endif
@@ -123,7 +123,7 @@ to64(char *s, int32_t v, int n)
}
}
#if PHP_WIN32
#ifdef PHP_WIN32
char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
HCRYPTPROV hCryptProv;
HCRYPTHASH ctx, ctx1;
+2 -2
View File
@@ -27,7 +27,7 @@
#include "zend_exceptions.h"
#include "php_random.h"
#if PHP_WIN32
#ifdef PHP_WIN32
# include "win32/winutil.h"
#endif
#ifdef __linux__
@@ -83,7 +83,7 @@ PHP_MSHUTDOWN_FUNCTION(random)
/* {{{ */
PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw)
{
#if PHP_WIN32
#ifdef PHP_WIN32
/* Defer to CryptGenRandom on Windows */
if (php_win32_get_random_bytes(bytes, size) == FAILURE) {
if (should_throw) {
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #72071 setcookie allows max-age to be negative
--INI--
date.timezone=UTC
--FILE--
<?php
$date = mktime(12, 25, 39, 4, 1, 2017);
setcookie("name", "value", $date);
?>
--EXPECT--
--EXPECTHEADERS--
Set-Cookie: name=value; expires=Sat, 01-Apr-2017 12:25:39 GMT; Max-Age=0
+1 -1
View File
@@ -26,7 +26,7 @@ $expected = array(
'Set-Cookie: name=space+value',
'Set-Cookie: name=value',
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsp).' GMT; Max-Age=5',
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=-6',
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=0',
'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsc).' GMT; Max-Age=0',
'Set-Cookie: name=value; path=/path/',
'Set-Cookie: name=value; domain=domain.tld',
@@ -1,37 +0,0 @@
--TEST--
Use of double-port in fsockopen()
--FILE--
<?php
$try = [
'127.0.0.1:80',
'tcp://127.0.0.1:80',
'[::1]:80',
'tcp://[::1]:80',
'localhost:80',
'tcp://localhost:80',
];
foreach ($try as $addr) {
echo "== $addr ==\n";
var_dump(@fsockopen($addr, 81, $errno, $errstr), $errstr);
}
--EXPECTF--
== 127.0.0.1:80 ==
bool(false)
string(41) "Failed to parse address "127.0.0.1:80:81""
== tcp://127.0.0.1:80 ==
bool(false)
string(41) "Failed to parse address "127.0.0.1:80:81""
== [::1]:80 ==
bool(false)
string(37) "Failed to parse address "[::1]:80:81""
== tcp://[::1]:80 ==
bool(false)
string(37) "Failed to parse address "[::1]:80:81""
== localhost:80 ==
bool(false)
string(41) "Failed to parse address "localhost:80:81""
== tcp://localhost:80 ==
bool(false)
string(41) "Failed to parse address "localhost:80:81""
+1
View File
@@ -19,6 +19,7 @@ EXPORTS
inflateSync
inflateCopy
inflateReset
inflateReset2
inflateBack
inflateBackEnd
zlibCompileFlags
+1 -1
View File
@@ -505,7 +505,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length,
(IS_SLASH(filename[1]) ||
((filename[1] == '.') && IS_SLASH(filename[2])))) ||
IS_ABSOLUTE_PATH(filename, filename_length) ||
#if PHP_WIN32
#ifdef PHP_WIN32
/* This should count as an absolute local path as well, however
IS_ABSOLUTE_PATH doesn't care about this path form till now. It
might be a big thing to extend, thus just a local handling for
+1 -1
View File
@@ -143,7 +143,7 @@ END_EXTERN_C()
#endif
#ifndef HAVE_SOCKLEN_T
# if PHP_WIN32
# ifdef PHP_WIN32
typedef int socklen_t;
# else
typedef unsigned int socklen_t;
+3 -3
View File
@@ -804,11 +804,11 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
zval *tmp2;
char *ptr;
#if PHP_WIN32
#ifdef PHP_WIN32
char path_bak[MAXPATHLEN];
#endif
#if PHP_WIN32
#ifdef PHP_WIN32
/* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */
if (path_len >= MAXPATHLEN) {
#else
@@ -817,7 +817,7 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
return;
}
#if PHP_WIN32
#ifdef PHP_WIN32
memcpy(path_bak, path, path_len);
path_bak[path_len] = 0;
TRANSLATE_SLASHES_LOWER(path_bak);
+1 -1
View File
@@ -121,7 +121,7 @@ typedef int php_socket_t;
/* #define PHP_USE_POLL_2_EMULATION 1 */
#if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL)
# include <sys/poll.h>
# include <poll.h>
typedef struct pollfd php_pollfd;
#else
typedef struct _php_pollfd {
+4 -4
View File
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 7
#define PHP_MINOR_VERSION 0
#define PHP_RELEASE_VERSION 18
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "7.0.18-dev"
#define PHP_VERSION_ID 70018
#define PHP_RELEASE_VERSION 19
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "7.0.19"
#define PHP_VERSION_ID 70019
+6 -1
View File
@@ -501,9 +501,14 @@ static int php_stream_temp_cast(php_stream *stream, int castas, void **ret)
return FAILURE;
}
file = php_stream_fopen_tmpfile();
if (file == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to create temporary file.");
return FAILURE;
}
/* perform the conversion and then pass the request on to the innerstream */
membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize);
file = php_stream_fopen_tmpfile();
php_stream_write(file, membuf, memsize);
pos = php_stream_tell(ts->innerstream);
+3 -3
View File
@@ -1302,7 +1302,7 @@ static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, i
return 0;
}
#if PHP_WIN32
#ifdef PHP_WIN32
if (!php_win32_check_trailing_space(url, (int)strlen(url))) {
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0;
@@ -1329,11 +1329,11 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
#endif
mode_t mode;
int ret = 0;
#if PHP_WIN32
#ifdef PHP_WIN32
int url_len = (int)strlen(url);
#endif
#if PHP_WIN32
#ifdef PHP_WIN32
if (!php_win32_check_trailing_space(url, url_len)) {
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0;
+11 -18
View File
@@ -571,44 +571,37 @@ static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *po
char *host = NULL;
#ifdef HAVE_IPV6
char *p;
if (*(str) == '[' && str_len > 1) {
/* IPV6 notation to specify raw address with port (i.e. [fe80::1]:80) */
char *p = memchr(str + 1, ']', str_len - 2), *e = NULL;
p = memchr(str + 1, ']', str_len - 2);
if (!p || *(p + 1) != ':') {
if (get_err) {
*err = strpprintf(0, "Failed to parse IPv6 address \"%s\"", str);
}
return NULL;
}
*portno = strtol(p + 2, &e, 10);
if (e && *e) {
if (get_err) {
*err = strpprintf(0, "Failed to parse address \"%s\"", str);
}
return NULL;
}
*portno = atoi(p + 2);
return estrndup(str + 1, p - str - 1);
}
#endif
if (str_len) {
colon = memchr(str, ':', str_len - 1);
} else {
colon = NULL;
}
if (colon) {
char *e = NULL;
*portno = strtol(colon + 1, &e, 10);
if (!e || !*e) {
return estrndup(str, colon - str);
*portno = atoi(colon + 1);
host = estrndup(str, colon - str);
} else {
if (get_err) {
*err = strpprintf(0, "Failed to parse address \"%s\"", str);
}
return NULL;
}
if (get_err) {
*err = strpprintf(0, "Failed to parse address \"%s\"", str);
}
return NULL;
return host;
}
static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno)
+1 -1
View File
@@ -1776,7 +1776,7 @@ ldap.max_links = -1
;opcache.interned_strings_buffer=4
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
; Only numbers between 200 and 1000000 are allowed.
;opcache.max_accelerated_files=2000
; The maximum percentage of "wasted" memory until a restart is scheduled.
+1 -1
View File
@@ -1776,7 +1776,7 @@ ldap.max_links = -1
;opcache.interned_strings_buffer=4
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
; Only numbers between 200 and 1000000 are allowed.
;opcache.max_accelerated_files=2000
; The maximum percentage of "wasted" memory until a restart is scheduled.
-1
View File
@@ -73,7 +73,6 @@ typedef struct {
zend_bool engine;
zend_bool xbithack;
zend_bool last_modified;
zend_bool post_read_error;
} php_apache2_info_struct;
extern zend_module_entry apache2_module_entry;
+1 -46
View File
@@ -63,33 +63,6 @@
#define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source"
#define PHP_SCRIPT "php7-script"
/* if apache's version is newer than 2.2.31 or 2.4.16 */
#if MODULE_MAGIC_COOKIE == 0x41503232UL && AP_MODULE_MAGIC_AT_LEAST(20051115,40) || \
MODULE_MAGIC_COOKIE == 0x41503234UL && AP_MODULE_MAGIC_AT_LEAST(20120211,47)
#define php_ap_map_http_request_error ap_map_http_request_error
#else
static int php_ap_map_http_request_error(apr_status_t rv, int status)
{
switch (rv) {
case AP_FILTER_ERROR: {
return AP_FILTER_ERROR;
}
case APR_ENOSPC: {
return HTTP_REQUEST_ENTITY_TOO_LARGE;
}
case APR_ENOTIMPL: {
return HTTP_NOT_IMPLEMENTED;
}
case APR_ETIMEDOUT: {
return HTTP_REQUEST_TIME_OUT;
}
default: {
return status;
}
}
}
#endif
/* A way to specify the location of the php.ini dir in an apache directive */
char *apache2_php_ini_path_override = NULL;
#if defined(PHP_WIN32) && defined(ZTS)
@@ -211,7 +184,6 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
php_struct *ctx = SG(server_context);
request_rec *r;
apr_bucket_brigade *brigade;
apr_status_t ret;
r = ctx->r;
brigade = ctx->brigade;
@@ -223,7 +195,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
* need to make sure that if data is available we fill the buffer completely.
*/
while ((ret=ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len)) == APR_SUCCESS) {
while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len) == APR_SUCCESS) {
apr_brigade_flatten(brigade, buf, &len);
apr_brigade_cleanup(brigade);
tlen += len;
@@ -234,15 +206,6 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
len = count_bytes - tlen;
}
if (ret != APR_SUCCESS) {
AP2(post_read_error) = 1;
if (APR_STATUS_IS_TIMEUP(ret)) {
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_REQUEST_TIME_OUT);
} else {
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_BAD_REQUEST);
}
}
return tlen;
}
@@ -524,7 +487,6 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx)
SG(request_info).proto_num = r->proto_num;
SG(request_info).request_uri = apr_pstrdup(r->pool, r->uri);
SG(request_info).path_translated = apr_pstrdup(r->pool, r->filename);
AP2(post_read_error) = 0;
r->no_local_copy = 1;
content_length = (char *) apr_table_get(r->headers_in, "Content-Length");
@@ -694,13 +656,6 @@ zend_first_try {
brigade = ctx->brigade;
}
if (AP2(post_read_error)) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Error while attempting to read POST data: %d", SG(sapi_headers).http_response_code);
apr_brigade_cleanup(brigade);
PHPAP_INI_OFF;
return SG(sapi_headers).http_response_code;
}
if (AP2(last_modified)) {
ap_update_mtime(r, r->finfo.mtime);
ap_set_last_modified(r);
+1 -1
View File
@@ -349,7 +349,7 @@ PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short
}
PHPDBG_API void phpdbg_close_socket(int sock) {
if (socket >= 0) {
if (sock >= 0) {
#ifdef _WIN32
closesocket(sock);
#else
+1 -1
View File
@@ -1257,7 +1257,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name)
handle = DL_LOAD(*path);
if (!handle) {
#if PHP_WIN32
#ifdef PHP_WIN32
char *err = GET_DL_ERROR();
if (err && err[0]) {
phpdbg_error("dl", "type=\"unknown\"", "%s", err);
+13 -2
View File
@@ -389,10 +389,17 @@ function conf_process_args()
} else {
/* we matched the non-default arg */
if (argval == null) {
argval = arg.defval == "no" ? "yes" : "no";
if (arg.defval == "no") {
argval = "yes";
} else if (arg.defval == "no,shared") {
argval = "yes,shared";
shared = true;
} else {
argval = "no";
}
}
}
arg.argval = argval;
eval("PHP_" + arg.symval + " = argval;");
eval("PHP_" + arg.symval + "_SHARED = shared;");
@@ -2663,6 +2670,10 @@ function toolset_setup_project_tools()
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;
+7 -7
View File
@@ -67,13 +67,13 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
if (handles[n_handles] == INVALID_HANDLE_VALUE) {
/* socket */
if (SAFE_FD_ISSET(i, rfds)) {
FD_SET((uint)i, &sock_read);
FD_SET((uint32_t)i, &sock_read);
}
if (SAFE_FD_ISSET(i, wfds)) {
FD_SET((uint)i, &sock_write);
FD_SET((uint32_t)i, &sock_write);
}
if (SAFE_FD_ISSET(i, efds)) {
FD_SET((uint)i, &sock_except);
FD_SET((uint32_t)i, &sock_except);
}
if (i > sock_max_fd) {
sock_max_fd = i;
@@ -117,7 +117,7 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
/* check handles */
DWORD wret;
wret = MsgWaitForMultipleObjects(n_handles, handles, FALSE, retcode > 0 ? 0 : 100, QS_ALLEVENTS);
wret = WaitForMultipleObjects(n_handles, handles, FALSE, retcode > 0 ? 0 : 100);
if (wret == WAIT_TIMEOUT) {
/* set retcode to 0; this is the default.
@@ -136,13 +136,13 @@ PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, stru
for (i = 0; i < n_handles; i++) {
if (WAIT_OBJECT_0 == WaitForSingleObject(handles[i], 0)) {
if (SAFE_FD_ISSET(handle_slot_to_fd[i], rfds)) {
FD_SET((uint)handle_slot_to_fd[i], &aread);
FD_SET((uint32_t)handle_slot_to_fd[i], &aread);
}
if (SAFE_FD_ISSET(handle_slot_to_fd[i], wfds)) {
FD_SET((uint)handle_slot_to_fd[i], &awrite);
FD_SET((uint32_t)handle_slot_to_fd[i], &awrite);
}
if (SAFE_FD_ISSET(handle_slot_to_fd[i], efds)) {
FD_SET((uint)handle_slot_to_fd[i], &aexcept);
FD_SET((uint32_t)handle_slot_to_fd[i], &aexcept);
}
retcode++;
}