mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-20 23:46:37 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e17e2b26b3 | ||
|
|
fbe2490ce0 |
No files matched your search
+1
-1
@@ -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.5
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.4
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
|
||||
@@ -1,83 +1,5 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
06 Jul 2017 PHP 7.0.21
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74738 (Multiple [PATH=] and [HOST=] sections not properly
|
||||
parsed). (Manuel Mausz)
|
||||
. Fixed bug #74658 (Undefined constants in array properties result in broken
|
||||
properties). (Laruence)
|
||||
. Fixed misparsing of abstract unix domain socket names. (Sara)
|
||||
. Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in
|
||||
zval_get_type). (Nikita)
|
||||
. Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from
|
||||
unserialize). (Nikita)
|
||||
. Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
|
||||
(Stas)
|
||||
. Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
|
||||
php_parse_date()). (Derick)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #69373 (References to deleted XPath query results). (ttoohey)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex)
|
||||
. Fixed bug #74705 (Wrong reflection on Collator::getSortKey and
|
||||
collator_get_sort_key). (Tyson Andre, Remi)
|
||||
. Fixed bug #73634 (grapheme_strpos illegal memory access). (Stas)
|
||||
|
||||
- Mbstring:
|
||||
. Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227,
|
||||
CVE-2017-9228, CVE-2017-9229) (Remi, Mamoru TASAKA)
|
||||
|
||||
- OCI8:
|
||||
. Add TAF callback (PR #2459). (KoenigsKind)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74663 (Segfault with opcache.memory_protect and
|
||||
validate_timestamp). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
|
||||
(Stas)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #74087 (Segmentation fault in PHP7.1.1(compiled using the bundled PCRE library)).
|
||||
(Stas)
|
||||
|
||||
- PDO_OCI:
|
||||
. Support Instant Client 12.2 in --with-pdo-oci configure option.
|
||||
(Tianfang Yang)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #74673 (Segfault when cast Reflection object to string with
|
||||
undefined constant). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #74478 (null coalescing operator failing with SplFixedArray).
|
||||
(jhdxr)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74708 (Invalid Reflection signatures for random_bytes and
|
||||
random_int). (Tyson Andre, Remi)
|
||||
. Fixed bug #73648 (Heap buffer overflow in substr). (Stas)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #74598 (ftp:// wrapper ignores context arg). (Sara)
|
||||
|
||||
- PHAR:
|
||||
. Fixed bug #74386 (Phar::__construct reflection incorrect). (villfa)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY).
|
||||
(Dmitry)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #74556 (stream_socket_get_name() returns '\0'). (Sara)
|
||||
|
||||
8 Jun 2017 PHP 7.0.20
|
||||
|
||||
- Core:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
0=0&~2000000000
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_MAX !== 2147483647)
|
||||
die('skip for 32-bit only');
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "0"
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74657 (Undefined constants in array properties result in broken properties)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
}
|
||||
|
||||
class C {
|
||||
const FOO = I::FOO;
|
||||
|
||||
public $options = [self::FOO => "bar"];
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump((new C)->options);
|
||||
} catch (Throwable $e) {}
|
||||
|
||||
var_dump((new C)->options);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Undefined class constant 'I::FOO' in %sbug74657.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug74657.php on line %d
|
||||
|
||||
+2
-2
@@ -1087,6 +1087,8 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
|
||||
ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
|
||||
{
|
||||
if (!(class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
|
||||
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
|
||||
|
||||
if (class_type->parent) {
|
||||
if (UNEXPECTED(zend_update_class_constants(class_type->parent) != SUCCESS)) {
|
||||
return FAILURE;
|
||||
@@ -1160,9 +1162,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
|
||||
|
||||
*scope = old_scope;
|
||||
}
|
||||
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -55,7 +55,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
|
||||
int i_result;
|
||||
int i_op1, i_op2;
|
||||
int str_len;
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
char str_result[MAX_LENGTH_OF_LONG];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
|
||||
+1
-4
@@ -29,8 +29,5 @@ if not exist "%SDK_RUNNER%" (
|
||||
exit /b 3
|
||||
)
|
||||
|
||||
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
exit /b 0
|
||||
call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
|
||||
|
||||
@@ -19,10 +19,10 @@ 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%
|
||||
cmd /c phpsdk_deps --update --no-backup --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
|
||||
|
||||
cmd /c buildconf.bat --force
|
||||
call buildconf.bat --force
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
|
||||
@@ -30,7 +30,7 @@ if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
|
||||
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba
|
||||
if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
|
||||
|
||||
cmd /c configure.bat ^
|
||||
call configure.bat ^
|
||||
--enable-snapshot-build ^
|
||||
--disable-debug-pack ^
|
||||
--with-mcrypt=shared ^
|
||||
|
||||
+1
-4
@@ -6,8 +6,5 @@ if not exist "%SDK_RUNNER%" (
|
||||
exit /b 3
|
||||
)
|
||||
|
||||
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
exit /b 0
|
||||
call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat
|
||||
|
||||
@@ -12,10 +12,6 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
|
||||
set STABILITY=staging
|
||||
)
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
|
||||
if not exist "%DEPS_DIR%" (
|
||||
echo "%DEPS_DIR%" doesn't exist
|
||||
exit /b 3
|
||||
)
|
||||
|
||||
rem setup MySQL related exts
|
||||
set MYSQL_PWD=Password12!
|
||||
@@ -29,7 +25,6 @@ set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST%
|
||||
set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT%
|
||||
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST% port=%PDO_MYSQL_TEST_PORT% dbname=test user=%PDO_MYSQL_TEST_USER% password=%MYSQL_PW%
|
||||
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test"
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
rem setup PostgreSQL related exts
|
||||
set PGUSER=postgres
|
||||
@@ -38,15 +33,12 @@ rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres pa
|
||||
echo ^<?php $conn_str = "host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD%"; ?^> >> "./ext/pgsql/tests/config.inc"
|
||||
set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD%
|
||||
"C:\Program Files\PostgreSQL\9.5\bin\createdb.exe" test
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
rem prepare for ext/openssl
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL
|
||||
if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL
|
||||
mkdir c:\usr\local\ssl
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
copy %DEPS_DIR%\template\ssl\openssl.cnf c:\usr\local\ssl
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
set OPENSSL_CONF=c:\usr\local\ssl\openssl.cnf
|
||||
rem set OPENSSL_CONF=
|
||||
rem set SSLEAY_CONF=
|
||||
@@ -56,13 +48,9 @@ if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enabled=1 -d opcache.enable_c
|
||||
|
||||
rem prepare for enchant
|
||||
mkdir c:\enchant_plugins
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
copy %DEPS_DIR%\bin\libenchant_ispell.dll c:\enchant_plugins
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
copy %DEPS_DIR%\bin\libenchant_myspell.dll c:\enchant_plugins
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
reg add HKEY_CURRENT_USER\SOFTWARE\Enchant\Config /v Module_Dir /t REG_SZ /d c:\enchant_plugins
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
set PHP_BUILD_CACHE_ENCHANT_DICT_DIR=%PHP_BUILD_CACHE_BASE_DIR%\enchant_dict
|
||||
if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" (
|
||||
echo Creating %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%
|
||||
@@ -85,5 +73,3 @@ mkdir c:\tests_tmp
|
||||
cd "%APPVEYOR_BUILD_FOLDER%"
|
||||
nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp"
|
||||
|
||||
exit /b %errorlevel%
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=21
|
||||
PHP_RELEASE_VERSION=20
|
||||
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`
|
||||
|
||||
+6879
-5975
File diff suppressed because it is too large.
Load diff
@@ -899,7 +899,7 @@ datefull = day ([ \t.-])* monthtext ([ \t.-])* year;
|
||||
datenoday = monthtext ([ .\t-])* year4;
|
||||
datenodayrev = year4 ([ .\t-])* monthtext;
|
||||
datetextual = monthtext ([ .\t-])* day [,.stndrh\t ]+ year;
|
||||
datenoyear = monthtext ([ .\t-])* day ([,.stndrh\t ]+|[\000]);
|
||||
datenoyear = monthtext ([ .\t-])* day [,.stndrh\t ]*;
|
||||
datenoyearrev = day ([ .\t-])* monthtext;
|
||||
datenocolon = year4 monthlz daylz;
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ foreach ( $tests as $start => $data )
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Fri, 15 Oct 2010 23:00:00 +0000
|
||||
Sat, 23 Oct 2010 00:00:00 +0000
|
||||
Wed, 15 Dec 2010 16:15:00 +0000
|
||||
Mon, 20 Dec 2010 00:00:00 +0000
|
||||
Mon, 20 Dec 2010 10:00:00 +0000
|
||||
Tue, 21 Dec 2010 12:00:00 +0000
|
||||
Mon, 03 Jan 2011 00:00:00 +0000
|
||||
Mon, 03 Jan 2011 09:00:00 +0000
|
||||
Fri, 15 Oct 2010 23:00:00 +0100
|
||||
Sat, 23 Oct 2010 00:00:00 +0100
|
||||
Sun, 28 Mar 2010 00:15:00 +0000
|
||||
Sun, 28 Mar 2010 02:15:00 +0100
|
||||
Sun, 28 Mar 2010 02:15:00 +0100
|
||||
@@ -337,8 +337,6 @@ int dom_node_node_value_write(dom_object *obj, zval *newval)
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
if (nodep->children) {
|
||||
node_list_unlink(nodep->children);
|
||||
php_libxml_node_free_list((xmlNodePtr) nodep->children);
|
||||
nodep->children = NULL;
|
||||
}
|
||||
case XML_TEXT_NODE:
|
||||
case XML_COMMENT_NODE:
|
||||
@@ -856,14 +854,6 @@ int dom_node_text_content_write(dom_object *obj, zval *newval)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE) {
|
||||
if (nodep->children) {
|
||||
node_list_unlink(nodep->children);
|
||||
php_libxml_node_free_list((xmlNodePtr) nodep->children);
|
||||
nodep->children = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
str = zval_get_string(newval);
|
||||
/* we have to use xmlNodeAddContent() to get the same behavior as with xmlNewText() */
|
||||
xmlNodeSetContent(nodep, (xmlChar *) "");
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
Bug #69373 References to deleted XPath query results
|
||||
--FILE--
|
||||
<?php
|
||||
$doc = new DOMDocument();
|
||||
for( $i=0; $i<20; $i++ ) {
|
||||
$doc->loadXML("<parent><child /><child /></parent>");
|
||||
$xpath = new DOMXpath($doc);
|
||||
$all = $xpath->query('//*');
|
||||
$doc->firstChild->nodeValue = '';
|
||||
}
|
||||
echo 'DONE', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -147,9 +147,6 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
|
||||
int haveGlobalColormap;
|
||||
gdImagePtr im = 0;
|
||||
|
||||
memset(ColorMap, 0, 3 * MAXCOLORMAPSIZE);
|
||||
memset(localColorMap, 0, 3 * MAXCOLORMAPSIZE);
|
||||
|
||||
/*1.4//imageNumber = 1; */
|
||||
if (! ReadOK(fd,buf,6)) {
|
||||
return 0;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74435 (Buffer over-read into uninitialized memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatefromgif(__DIR__ . DIRECTORY_SEPARATOR . 'bug74435.gif');
|
||||
var_dump($im);
|
||||
$width = imagesx($im);
|
||||
$height = imagesy($im);
|
||||
for ($i = 0; $i < $width; $i += 16) {
|
||||
for ($j = 0; $j < $height; $j += 16) {
|
||||
if (($index = imagecolorat($im, $i, $j)) >= 2) {
|
||||
list($red, $green, $blue, $alpha) = array_values(imagecolorsforindex($im, $index));
|
||||
if ($red !== 0 || $green !== 0 || $blue !== 0 || $alpha !== 0) {
|
||||
echo "unexpected color at ($i, $j)\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (gd)
|
||||
===DONE===
|
||||
@@ -119,7 +119,7 @@ zend_function_entry Collator_class_functions[] = {
|
||||
PHP_NAMED_FE( getLocale, ZEND_FN( collator_get_locale ), collator_1_arg )
|
||||
PHP_NAMED_FE( getErrorCode, ZEND_FN( collator_get_error_code ), collator_0_args )
|
||||
PHP_NAMED_FE( getErrorMessage, ZEND_FN( collator_get_error_message ), collator_0_args )
|
||||
PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_1_arg )
|
||||
PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_2_args )
|
||||
PHP_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -110,8 +110,7 @@ PHP_FUNCTION(grapheme_strpos)
|
||||
size_t haystack_len, needle_len;
|
||||
const char *found;
|
||||
zend_long loffset = 0;
|
||||
int32_t offset = 0;
|
||||
size_t noffset = 0;
|
||||
int32_t offset = 0, noffset = 0;
|
||||
zend_long ret_pos;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &haystack, &haystack_len, &needle, &needle_len, &loffset) == FAILURE) {
|
||||
|
||||
@@ -110,7 +110,6 @@ PHP_FUNCTION( msgfmt_parse_message )
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN(slocale_len);
|
||||
memset(mfo, 0, sizeof(*mfo));
|
||||
msgformat_data_init(&mfo->mf_data);
|
||||
|
||||
|
||||
+1
-1
@@ -655,7 +655,7 @@ zend_function_entry intl_functions[] = {
|
||||
PHP_FE( collator_get_locale, collator_1_arg )
|
||||
PHP_FE( collator_get_error_code, collator_0_args )
|
||||
PHP_FE( collator_get_error_message, collator_0_args )
|
||||
PHP_FE( collator_get_sort_key, collator_1_arg )
|
||||
PHP_FE( collator_get_sort_key, collator_2_args )
|
||||
|
||||
/* formatter functions */
|
||||
PHP_FE( numfmt_create, arginfo_numfmt_create )
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74705 Wrong reflection on Collator::getSortKey
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$rm = new ReflectionMethod(Collator::class, 'getSortKey');
|
||||
var_dump($rm->getNumberOfParameters());
|
||||
var_dump($rm->getNumberOfRequiredParameters());
|
||||
|
||||
$rf = new ReflectionFunction('collator_get_sort_key');
|
||||
var_dump($rf->getNumberOfParameters());
|
||||
var_dump($rf->getNumberOfRequiredParameters());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
int(2)
|
||||
int(2)
|
||||
===DONE===
|
||||
+1
-1
@@ -8,7 +8,7 @@ data-interchange format as specified in RFC 7159
|
||||
The parser is implemented using re2c and Bison. The used versions
|
||||
of both tools for generating files in the repository are following:
|
||||
|
||||
re2c 0.16
|
||||
re2c 0.14.3
|
||||
Bison 3.0.4
|
||||
|
||||
It is recommended to do all contributions to the JSON extension
|
||||
|
||||
+705
-637
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.16 */
|
||||
/* Generated by re2c 0.14.3 */
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycJS,
|
||||
|
||||
+2
-2
@@ -366,7 +366,7 @@ PHP_FUNCTION(ldap_connect)
|
||||
{
|
||||
int rc = LDAP_SUCCESS;
|
||||
char *url = host;
|
||||
if (url && !ldap_is_ldap_url(url)) {
|
||||
if (!ldap_is_ldap_url(url)) {
|
||||
int urllen = hostlen + sizeof( "ldap://:65535" );
|
||||
|
||||
if (port <= 0 || port > 65535) {
|
||||
@@ -376,7 +376,7 @@ PHP_FUNCTION(ldap_connect)
|
||||
}
|
||||
|
||||
url = emalloc(urllen);
|
||||
snprintf( url, urllen, "ldap://%s:%ld", host, port );
|
||||
snprintf( url, urllen, "ldap://%s:%ld", host ? host : "", port );
|
||||
}
|
||||
|
||||
#ifdef LDAP_API_FEATURE_X_OPENLDAP
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
ldap_connect() - Connection using default host from openldap's ldap.conf
|
||||
--CREDITS--
|
||||
David Caldwell <david@galvanix.com>
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
ob_start();
|
||||
phpinfo();
|
||||
if (!preg_match("/vendor name => openldap/i", ob_get_clean()))
|
||||
die("skip not openldap");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$conf=tempnam("/tmp","ldap.conf");
|
||||
file_put_contents($conf, "uri ldaps://example.com:3141/");
|
||||
putenv("LDAPCONF=$conf");
|
||||
$link = ldap_connect();
|
||||
ldap_get_option($link, LDAP_OPT_HOST_NAME, $host);
|
||||
var_dump($host);
|
||||
unlink($conf);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
string(16) "example.com:3141"
|
||||
===DONE===
|
||||
+1
-1
@@ -224,7 +224,7 @@ static void php_libxml_node_free(xmlNodePtr node)
|
||||
}
|
||||
}
|
||||
|
||||
PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node)
|
||||
static void php_libxml_node_free_list(xmlNodePtr node)
|
||||
{
|
||||
xmlNodePtr curnode;
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object);
|
||||
PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object);
|
||||
PHP_LIBXML_API zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function);
|
||||
/* When an explicit freeing of node and children is required */
|
||||
PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node);
|
||||
PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node);
|
||||
/* When object dtor is called as node may still be referenced */
|
||||
PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object);
|
||||
|
||||
@@ -1425,9 +1425,14 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
|
||||
break;
|
||||
|
||||
case OP_EXACT1: MOP_IN(OP_EXACT1);
|
||||
#if 0
|
||||
DATA_ENSURE(1);
|
||||
if (*p != *s) goto fail;
|
||||
p++; s++;
|
||||
#endif
|
||||
if (*p != *s++) goto fail;
|
||||
DATA_ENSURE(0);
|
||||
p++;
|
||||
MOP_OUT;
|
||||
break;
|
||||
|
||||
@@ -3123,8 +3128,6 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
|
||||
}
|
||||
else {
|
||||
UChar *q = p + reg->dmin;
|
||||
|
||||
if (q >= end) return 0; /* fail */
|
||||
while (p < q) p += enclen(reg->enc, p);
|
||||
}
|
||||
}
|
||||
@@ -3205,13 +3208,7 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
|
||||
else {
|
||||
if (reg->dmax != ONIG_INFINITE_DISTANCE) {
|
||||
*low = p - reg->dmax;
|
||||
if (p - str < reg->dmax) {
|
||||
*low = (UChar* )str;
|
||||
if (low_prev)
|
||||
*low_prev = onigenc_get_prev_char_head(reg->enc, str, *low);
|
||||
}
|
||||
else {
|
||||
if (*low > s) {
|
||||
if (*low > s) {
|
||||
*low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
|
||||
*low, (const UChar** )low_prev);
|
||||
if (low_prev && IS_NULL(*low_prev))
|
||||
@@ -3224,7 +3221,6 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
|
||||
(pprev ? pprev : str), *low);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* no needs to adjust *high, *high is used as range check only */
|
||||
*high = p - reg->dmin;
|
||||
|
||||
@@ -3064,7 +3064,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
|
||||
PUNFETCH;
|
||||
prev = p;
|
||||
num = scan_unsigned_octal_number(&p, end, 3, enc);
|
||||
if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (p == prev) { /* can't read nothing. */
|
||||
num = 0; /* but, it's not error */
|
||||
}
|
||||
@@ -3436,7 +3436,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
|
||||
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
|
||||
prev = p;
|
||||
num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
|
||||
if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (p == prev) { /* can't read nothing. */
|
||||
num = 0; /* but, it's not error */
|
||||
}
|
||||
@@ -4068,9 +4068,7 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
|
||||
}
|
||||
}
|
||||
|
||||
if (*state != CCS_START)
|
||||
*state = CCS_VALUE;
|
||||
|
||||
*state = CCS_VALUE;
|
||||
*type = CCV_CLASS;
|
||||
return 0;
|
||||
}
|
||||
@@ -4086,11 +4084,7 @@ next_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v,
|
||||
switch (*state) {
|
||||
case CCS_VALUE:
|
||||
if (*type == CCV_SB)
|
||||
{
|
||||
if (*vs > 0xff)
|
||||
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
||||
BITSET_SET_BIT(cc->bs, (int )(*vs));
|
||||
}
|
||||
else if (*type == CCV_CODE_POINT) {
|
||||
r = add_code_range(&(cc->mbuf), env, *vs, *vs);
|
||||
if (r < 0) return r;
|
||||
|
||||
+2
-2
@@ -335,7 +335,7 @@ if test "$PHP_OCI8" != "no"; then
|
||||
|
||||
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
|
||||
PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
|
||||
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c, $ext_shared)
|
||||
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared)
|
||||
AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured])
|
||||
|
||||
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
|
||||
@@ -406,7 +406,7 @@ if test "$PHP_OCI8" != "no"; then
|
||||
|
||||
AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[Defined to 1 if OCI8 configuration located Oracle's Instant Client libraries])
|
||||
|
||||
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c, $ext_shared)
|
||||
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared)
|
||||
AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured])
|
||||
|
||||
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
|
||||
|
||||
+2
-2
@@ -80,7 +80,7 @@ if (PHP_OCI8_11G != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) &&
|
||||
CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths))
|
||||
{
|
||||
EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c', null, null, null, "ext\\oci8_11g")
|
||||
EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_11g")
|
||||
|
||||
AC_DEFINE('HAVE_OCI8', 1);
|
||||
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
|
||||
@@ -115,7 +115,7 @@ if (PHP_OCI8_12C != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_12C", oci8_12c_inc_paths) &&
|
||||
CHECK_LIB("oci.lib", "oci8_12c", oci8_12c_lib_paths))
|
||||
{
|
||||
EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c', null, null, null, "ext\\oci8_12c")
|
||||
EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_12c")
|
||||
|
||||
AC_DEFINE('HAVE_OCI8', 1);
|
||||
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
|
||||
|
||||
@@ -504,11 +504,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_collection, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, type_name)
|
||||
ZEND_ARG_INFO(0, schema_name)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_register_taf_callback, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, connection_resource)
|
||||
ZEND_ARG_INFO(0, function_name)
|
||||
ZEND_END_ARG_INFO()
|
||||
/* }}} */
|
||||
|
||||
/* {{{ LOB Method arginfo */
|
||||
@@ -706,7 +701,6 @@ PHP_FUNCTION(oci_collection_assign);
|
||||
PHP_FUNCTION(oci_collection_size);
|
||||
PHP_FUNCTION(oci_collection_max);
|
||||
PHP_FUNCTION(oci_collection_trim);
|
||||
PHP_FUNCTION(oci_register_taf_callback);
|
||||
/* }}} */
|
||||
|
||||
/* {{{ extension definition structures
|
||||
@@ -789,7 +783,6 @@ static const zend_function_entry php_oci_functions[] = {
|
||||
PHP_FE(oci_collection_max, arginfo_oci_collection_max)
|
||||
PHP_FE(oci_collection_trim, arginfo_oci_collection_trim)
|
||||
PHP_FE(oci_new_collection, arginfo_oci_new_collection)
|
||||
PHP_FE(oci_register_taf_callback, arginfo_oci_register_taf_callback)
|
||||
|
||||
PHP_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_statement)
|
||||
PHP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement)
|
||||
@@ -1136,20 +1129,6 @@ PHP_MINIT_FUNCTION(oci)
|
||||
REGISTER_LONG_CONSTANT("OCI_TEMP_CLOB",OCI_TEMP_CLOB, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_TEMP_BLOB",OCI_TEMP_BLOB, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
/* for Transparent Application Failover */
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_END", OCI_FO_END, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_ABORT", OCI_FO_ABORT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_REAUTH", OCI_FO_REAUTH, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_BEGIN", OCI_FO_BEGIN, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_ERROR", OCI_FO_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_NONE", OCI_FO_NONE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_SESSION", OCI_FO_SESSION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_SELECT", OCI_FO_SELECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_TXNAL", OCI_FO_TXNAL, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
REGISTER_LONG_CONSTANT("OCI_FO_RETRY", OCI_FO_RETRY, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1951,7 +1930,6 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
|
||||
connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection));
|
||||
connection->hash_key = zend_string_dup(hashed_details.s, 0);
|
||||
connection->is_persistent = 0;
|
||||
ZVAL_UNDEF(&connection->taf_callback);
|
||||
#ifdef HAVE_OCI8_DTRACE
|
||||
connection->client_id = NULL;
|
||||
#endif
|
||||
@@ -1966,7 +1944,6 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
|
||||
return NULL;
|
||||
}
|
||||
connection->is_persistent = 1;
|
||||
ZVAL_UNDEF(&connection->taf_callback);
|
||||
#ifdef HAVE_OCI8_DTRACE
|
||||
connection->client_id = NULL;
|
||||
#endif
|
||||
@@ -1975,7 +1952,6 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
|
||||
connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection));
|
||||
connection->hash_key = zend_string_dup(hashed_details.s, 0);
|
||||
connection->is_persistent = 0;
|
||||
ZVAL_UNDEF(&connection->taf_callback);
|
||||
#ifdef HAVE_OCI8_DTRACE
|
||||
connection->client_id = NULL;
|
||||
#endif
|
||||
@@ -2249,15 +2225,6 @@ static int php_oci_connection_close(php_oci_connection *connection)
|
||||
connection->client_id = NULL;
|
||||
}
|
||||
#endif /* HAVE_OCI8_DTRACE */
|
||||
|
||||
if (!Z_ISUNDEF(connection->taf_callback)) {
|
||||
/* If it's NULL, then its value should be freed already */
|
||||
if (!Z_ISNULL(connection->taf_callback)) {
|
||||
zval_ptr_dtor(&connection->taf_callback);
|
||||
}
|
||||
ZVAL_UNDEF(&connection->taf_callback);
|
||||
}
|
||||
|
||||
pefree(connection, connection->is_persistent);
|
||||
connection = NULL;
|
||||
OCI_G(in_call) = in_call_save;
|
||||
@@ -2700,11 +2667,6 @@ static int php_oci_persistent_helper(zval *zv)
|
||||
if (le->type == le_pconnection) {
|
||||
connection = (php_oci_connection *)le->ptr;
|
||||
|
||||
/* Remove TAF callback function as it's bound to current request */
|
||||
if (connection->used_this_request && !Z_ISUNDEF(connection->taf_callback) && !Z_ISNULL(connection->taf_callback)) {
|
||||
php_oci_disable_taf_callback(connection);
|
||||
}
|
||||
|
||||
if (!connection->used_this_request && OCI_G(persistent_timeout) != -1) {
|
||||
#ifdef HAVE_OCI8_DTRACE
|
||||
if (DTRACE_OCI8_CONNECT_EXPIRY_ENABLED()) {
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2016 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@php.net> |
|
||||
| Thies C. Arntzen <thies@thieso.net> |
|
||||
| |
|
||||
| Collection support by Andy Sautins <asautins@veripost.net> |
|
||||
| Temporary LOB support by David Benson <dbenson@mancala.com> |
|
||||
| ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> |
|
||||
| |
|
||||
| Redesigned by: Antony Dovgal <antony@zend.com> |
|
||||
| Andi Gutmans <andi@zend.com> |
|
||||
| Wez Furlong <wez@omniti.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "php_ini.h"
|
||||
|
||||
#if HAVE_OCI8
|
||||
|
||||
#include "php_oci8.h"
|
||||
#include "php_oci8_int.h"
|
||||
|
||||
/* {{{ callback_fn()
|
||||
OCI TAF callback function, calling userspace function */
|
||||
sb4 callback_fn(OCISvcCtx *svchp, OCIEnv *envhp, php_oci_connection *fo_ctx, ub4 fo_type, ub4 fo_event)
|
||||
{
|
||||
/* Create zval */
|
||||
zval retval, params[3];
|
||||
|
||||
/* Default return value */
|
||||
sb4 returnValue = 0;
|
||||
|
||||
/* Check if userspace callback function was disabled */
|
||||
if (Z_ISUNDEF(fo_ctx->taf_callback) || Z_ISNULL(fo_ctx->taf_callback)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize zval */
|
||||
ZVAL_RES(¶ms[0], fo_ctx->id);
|
||||
ZVAL_LONG(¶ms[1], fo_event);
|
||||
ZVAL_LONG(¶ms[2], fo_type);
|
||||
|
||||
/* Call user function (if possible) */
|
||||
if (call_user_function(EG(function_table), NULL, &fo_ctx->taf_callback, &retval, 3, params) == FAILURE) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to call taf callback function, is it defined?");
|
||||
}
|
||||
|
||||
/* Set return value */
|
||||
if (Z_TYPE(retval) == IS_LONG) {
|
||||
returnValue = (sb4) Z_LVAL(retval);
|
||||
}
|
||||
|
||||
/* Setting params[0] to null so ressource isn't destroyed on zval_dtor */
|
||||
ZVAL_NULL(¶ms[0]);
|
||||
|
||||
/* Cleanup */
|
||||
zval_dtor(&retval);
|
||||
zval_dtor(¶ms[0]);
|
||||
zval_dtor(¶ms[1]);
|
||||
zval_dtor(¶ms[2]);
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_oci_disable_taf_callback()
|
||||
Disables the userspace callback function for Oracle TAF,
|
||||
while keeping the OCI callback alive */
|
||||
int php_oci_disable_taf_callback(php_oci_connection *connection)
|
||||
{
|
||||
return php_oci_register_taf_callback(connection, NULL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_oci_register_taf_callback()
|
||||
Register a callback function for Oracle TAF */
|
||||
int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback)
|
||||
{
|
||||
sword errstatus;
|
||||
int registered = 0;
|
||||
|
||||
/* temporary failover callback structure */
|
||||
OCIFocbkStruct failover;
|
||||
|
||||
if (!callback) {
|
||||
/* Disable callback */
|
||||
if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) {
|
||||
return 0; // Nothing to disable
|
||||
}
|
||||
|
||||
registered = 1;
|
||||
zval_ptr_dtor(&connection->taf_callback);
|
||||
ZVAL_NULL(&connection->taf_callback);
|
||||
} else {
|
||||
if (!Z_ISUNDEF(connection->taf_callback)) {
|
||||
registered = 1;
|
||||
if (!Z_ISNULL(connection->taf_callback)) {
|
||||
zval_ptr_dtor(&connection->taf_callback);
|
||||
ZVAL_NULL(&connection->taf_callback);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set userspace callback function */
|
||||
ZVAL_COPY(&connection->taf_callback, callback);
|
||||
}
|
||||
|
||||
/* OCI callback function already registered */
|
||||
if (registered) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* set context */
|
||||
failover.fo_ctx = connection;
|
||||
|
||||
/* set callback function */
|
||||
failover.callback_function = &callback_fn;
|
||||
|
||||
/* do the registration */
|
||||
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (connection->server, (ub4) OCI_HTYPE_SERVER, (void *) &failover, (ub4) 0, (ub4) OCI_ATTR_FOCBK, connection->err));
|
||||
|
||||
if (errstatus != OCI_SUCCESS) {
|
||||
zval_ptr_dtor(&connection->taf_callback);
|
||||
ZVAL_UNDEF(&connection->taf_callback);
|
||||
connection->errcode = php_oci_error(connection->err, errstatus);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* successful conclusion */
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif /* HAVE_OCI8 */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: noet sw=4 ts=4 fdm=marker
|
||||
* vim<600: noet sw=4 ts=4
|
||||
*/
|
||||
@@ -42,39 +42,6 @@
|
||||
#define OCI_STMT_CALL 10
|
||||
#endif
|
||||
|
||||
/* {{{ proto bool oci_register_taf_callback( resource connection [, mixed callback] )
|
||||
Register a callback function for Oracle Transparent Application Failover (TAF) */
|
||||
PHP_FUNCTION(oci_register_taf_callback)
|
||||
{
|
||||
zval *z_connection;
|
||||
php_oci_connection *connection;
|
||||
zval *callback;
|
||||
zend_string *callback_name;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!", &z_connection, &callback) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
if (!zend_is_callable(callback, 0, &callback_name)) {
|
||||
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name));
|
||||
zend_string_release(callback_name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
zend_string_release(callback_name);
|
||||
}
|
||||
|
||||
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
|
||||
|
||||
if (php_oci_register_taf_callback(connection, callback) == 0) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool oci_define_by_name(resource stmt, string name, mixed &var [, int type])
|
||||
Define a PHP variable to an Oracle column by name */
|
||||
/* if you want to define a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE defining!!! */
|
||||
@@ -1586,9 +1553,6 @@ PHP_FUNCTION(oci_close)
|
||||
internally Zend engine increments
|
||||
RefCount value by 1 */
|
||||
zend_list_close(connection->id);
|
||||
|
||||
/* Disable Oracle TAF */
|
||||
php_oci_disable_taf_callback(connection);
|
||||
|
||||
/* ZVAL_NULL(z_connection); */
|
||||
|
||||
|
||||
+1
-18
@@ -46,7 +46,7 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<active>no</active>
|
||||
</lead>
|
||||
|
||||
<date>2017-06-20</date>
|
||||
<date>2017-04-12</date>
|
||||
<time>12:00:00</time>
|
||||
|
||||
<version>
|
||||
@@ -447,7 +447,6 @@ Fixed uninitialized data causing random crash
|
||||
<file name="oci8_interface.c" role="src" />
|
||||
<file name="oci8_lob.c" role="src" />
|
||||
<file name="oci8_statement.c" role="src" />
|
||||
<file name="oci8_failover.c" role="src" />
|
||||
<file name="php_oci8.h" role="src" />
|
||||
<file name="php_oci8_int.h" role="src" />
|
||||
<file name="README" role="doc" />
|
||||
@@ -469,22 +468,6 @@ Fixed uninitialized data causing random crash
|
||||
</extsrcrelease>
|
||||
<changelog>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.5</release>
|
||||
<api>2.1.5</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.
|
||||
Added TAF callback support (PR #2459, KoenigsKind)
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.3</release>
|
||||
|
||||
+1
-2
@@ -43,12 +43,11 @@
|
||||
*/
|
||||
#undef PHP_OCI8_VERSION
|
||||
#endif
|
||||
#define PHP_OCI8_VERSION "2.1.5"
|
||||
#define PHP_OCI8_VERSION "2.1.4"
|
||||
|
||||
extern zend_module_entry oci8_module_entry;
|
||||
#define phpext_oci8_ptr &oci8_module_entry
|
||||
#define phpext_oci8_11g_ptr &oci8_module_entry
|
||||
#define phpext_oci8_12c_ptr &oci8_module_entry
|
||||
|
||||
|
||||
PHP_MINIT_FUNCTION(oci);
|
||||
|
||||
@@ -164,8 +164,6 @@ typedef struct {
|
||||
#ifdef HAVE_OCI8_DTRACE
|
||||
char *client_id; /* The oci_set_client_identifier() value */
|
||||
#endif
|
||||
|
||||
zval taf_callback; /* The Oracle TAF callback function in the userspace */
|
||||
} php_oci_connection;
|
||||
/* }}} */
|
||||
|
||||
@@ -533,13 +531,6 @@ ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ Module globals */
|
||||
char *edition;
|
||||
ZEND_END_MODULE_GLOBALS(oci) /* }}} */
|
||||
|
||||
/* {{{ transparent failover related prototypes */
|
||||
|
||||
int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback);
|
||||
int php_oci_disable_taf_callback(php_oci_connection *connection);
|
||||
|
||||
/* }}} */
|
||||
|
||||
#ifdef ZTS
|
||||
#define OCI_G(v) TSRMG(oci_globals_id, zend_oci_globals *, v)
|
||||
#else
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
--TEST--
|
||||
Tests for LOBs with multibyte strings, reading them out in chunks
|
||||
(Doc Bug #70700)
|
||||
--CREDITS--
|
||||
Chuck Burgess
|
||||
ashnazg@php.net
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip mbstring is not enabled');
|
||||
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
|
||||
require(dirname(__FILE__).'/skipif.inc');
|
||||
?>
|
||||
--ENV--
|
||||
NLS_LANG=.AL32UTF8
|
||||
--FILE--
|
||||
<?php
|
||||
require(dirname(__FILE__).'/connect.inc');
|
||||
|
||||
|
||||
$stmt = oci_parse($c, 'DROP TABLE oci8_bug70700');
|
||||
@oci_execute($stmt);
|
||||
oci_free_statement($stmt);
|
||||
$stmt = oci_parse($c, 'CREATE TABLE oci8_bug70700 (id NUMBER, data CLOB)');
|
||||
oci_execute($stmt);
|
||||
oci_free_statement($stmt);
|
||||
|
||||
|
||||
$id = null;
|
||||
$insert = oci_parse($c, 'INSERT INTO oci8_bug70700 (id, data) VALUES (:id, :data)');
|
||||
oci_bind_by_name($insert, ':id', $id);
|
||||
$select = oci_parse($c, "SELECT data FROM oci8_bug70700 WHERE id = :id");
|
||||
oci_bind_by_name($select, ':id', $id);
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 1: j', PHP_EOL;
|
||||
$string1 = 'abc' . str_repeat('j', 1000000) . 'xyz';
|
||||
$id = 1;
|
||||
$desc = oci_new_descriptor($c, OCI_D_LOB);
|
||||
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
|
||||
$desc->writeTemporary($string1, OCI_TEMP_CLOB);
|
||||
oci_execute($insert);
|
||||
$desc->save($string1);
|
||||
oci_commit($c);
|
||||
$desc->close();
|
||||
oci_bind_by_name($select, ':id', $id);
|
||||
oci_execute($select);
|
||||
$row = oci_fetch_array($select, OCI_ASSOC);
|
||||
$lob = $row['DATA'];
|
||||
$fh = fopen('php://temp', 'rw');
|
||||
while (! $lob->eof()) {
|
||||
$data = $lob->read(8192); // read($characters), not read($bytes)
|
||||
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
|
||||
}
|
||||
$lob->free();
|
||||
rewind($fh);
|
||||
$stream1a = stream_get_contents($fh);
|
||||
fclose($fh);
|
||||
$start1a = mb_substr($stream1a, 0, 10);
|
||||
$ending1a = mb_substr($stream1a, -10);
|
||||
echo 'size of string1 is ', strlen($string1), ' bytes, ', mb_strlen($string1), ' chars.', PHP_EOL;
|
||||
echo 'size of stream1a is ', strlen($stream1a), ' bytes, ', mb_strlen($stream1a), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream1a is ', $start1a, PHP_EOL;
|
||||
echo 'end of stream1a is ', $ending1a, PHP_EOL;
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 2: £', PHP_EOL;
|
||||
$string2 = 'abc' . str_repeat('£', 4094) . 'xyz';
|
||||
$id = 2;
|
||||
$desc = oci_new_descriptor($c, OCI_D_LOB);
|
||||
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
|
||||
$desc->writeTemporary($string2, OCI_TEMP_CLOB);
|
||||
oci_execute($insert);
|
||||
$desc->save($string2);
|
||||
oci_commit($c);
|
||||
$desc->close();
|
||||
oci_bind_by_name($select, ':id', $id);
|
||||
oci_execute($select);
|
||||
$row = oci_fetch_array($select, OCI_ASSOC);
|
||||
$lob = $row['DATA'];
|
||||
$fh = fopen('php://temp', 'rw');
|
||||
while (! $lob->eof()) {
|
||||
$data = $lob->read(8192); // read($characters), not read($bytes)
|
||||
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
|
||||
}
|
||||
$lob->free();
|
||||
rewind($fh);
|
||||
$stream2a = stream_get_contents($fh);
|
||||
fclose($fh);
|
||||
$start2a = mb_substr($stream2a, 0, 10);
|
||||
$ending2a = mb_substr($stream2a, -10);
|
||||
echo 'size of string2 is ', strlen($string2), ' bytes, ', mb_strlen($string2), ' chars.', PHP_EOL;
|
||||
echo 'size of stream2a is ', strlen($stream2a), ' bytes, ', mb_strlen($stream2a), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream2a is ', $start2a, PHP_EOL;
|
||||
echo 'end of stream2a is ', $ending2a, PHP_EOL;
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 3: Җ', PHP_EOL;
|
||||
$string3 = 'abc' . str_repeat('Җ', 4094) . 'xyz';
|
||||
$id = 3;
|
||||
$desc = oci_new_descriptor($c, OCI_D_LOB);
|
||||
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
|
||||
$desc->writeTemporary($string3, OCI_TEMP_CLOB);
|
||||
oci_execute($insert);
|
||||
$desc->save($string3);
|
||||
oci_commit($c);
|
||||
$desc->close();
|
||||
oci_bind_by_name($select, ':id', $id);
|
||||
oci_execute($select);
|
||||
$row = oci_fetch_array($select, OCI_ASSOC);
|
||||
$lob = $row['DATA'];
|
||||
$fh = fopen('php://temp', 'rw');
|
||||
while (! $lob->eof()) {
|
||||
$data = $lob->read(8192); // read($characters), not read($bytes)
|
||||
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
|
||||
}
|
||||
$lob->free();
|
||||
rewind($fh);
|
||||
$stream3a = stream_get_contents($fh);
|
||||
fclose($fh);
|
||||
$start3a = mb_substr($stream3a, 0, 10);
|
||||
$ending3a = mb_substr($stream3a, -10);
|
||||
echo 'size of string3 is ', strlen($string3), ' bytes, ', mb_strlen($string3), ' chars.', PHP_EOL;
|
||||
echo 'size of stream3a is ', strlen($stream3a), ' bytes, ', mb_strlen($stream3a), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream3a is ', $start3a, PHP_EOL;
|
||||
echo 'end of stream3a is ', $ending3a, PHP_EOL;
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 4: の', PHP_EOL;
|
||||
$string4 = 'abc' . str_repeat('の', 2729) . 'xyz';
|
||||
$id = 4;
|
||||
$desc = oci_new_descriptor($c, OCI_D_LOB);
|
||||
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
|
||||
$desc->writeTemporary($string4, OCI_TEMP_CLOB);
|
||||
oci_execute($insert);
|
||||
$desc->save($string4);
|
||||
oci_commit($c);
|
||||
$desc->close();
|
||||
oci_bind_by_name($select, ':id', $id);
|
||||
oci_execute($select);
|
||||
$row = oci_fetch_array($select, OCI_ASSOC);
|
||||
$lob = $row['DATA'];
|
||||
$fh = fopen('php://temp', 'rw');
|
||||
while (! $lob->eof()) {
|
||||
$data = $lob->read(8192); // read($characters), not read($bytes)
|
||||
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
|
||||
}
|
||||
$lob->free();
|
||||
rewind($fh);
|
||||
$stream4a = stream_get_contents($fh);
|
||||
fclose($fh);
|
||||
$start4a = mb_substr($stream4a, 0, 10);
|
||||
$ending4a = mb_substr($stream4a, -10);
|
||||
echo 'size of string4 is ', strlen($string4), ' bytes, ', mb_strlen($string4), ' chars.', PHP_EOL;
|
||||
echo 'size of stream4a is ', strlen($stream4a), ' bytes, ', mb_strlen($stream4a), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream4a is ', $start4a, PHP_EOL;
|
||||
echo 'end of stream4a is ', $ending4a, PHP_EOL;
|
||||
|
||||
--EXPECTF--
|
||||
|
||||
Test 1: j
|
||||
size of string1 is 1000006 bytes, 1000006 chars.
|
||||
size of stream1a is 1000006 bytes, 1000006 chars.
|
||||
beg of stream1a is abcjjjjjjj
|
||||
end of stream1a is jjjjjjjxyz
|
||||
|
||||
Test 2: £
|
||||
size of string2 is 8194 bytes, 4100 chars.
|
||||
size of stream2a is 8194 bytes, 4100 chars.
|
||||
beg of stream2a is abc£££££££
|
||||
end of stream2a is £££££££xyz
|
||||
|
||||
Test 3: Җ
|
||||
size of string3 is 8194 bytes, 4100 chars.
|
||||
size of stream3a is 8194 bytes, 4100 chars.
|
||||
beg of stream3a is abcҖҖҖҖҖҖҖ
|
||||
end of stream3a is ҖҖҖҖҖҖҖxyz
|
||||
|
||||
Test 4: の
|
||||
size of string4 is 8193 bytes, 2735 chars.
|
||||
size of stream4a is 8193 bytes, 2735 chars.
|
||||
beg of stream4a is abcののののののの
|
||||
end of stream4a is のののののののxyz
|
||||
|
||||
@@ -485,7 +485,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
|
||||
|
||||
zend_string_release(lc_name);
|
||||
if (!m) {
|
||||
if (PG(enable_dl)) {
|
||||
if (!PG(enable_dl)) {
|
||||
break;
|
||||
} else {
|
||||
ZVAL_FALSE(&t);
|
||||
|
||||
@@ -957,17 +957,6 @@ int validate_timestamp_and_record(zend_persistent_script *persistent_script, zen
|
||||
}
|
||||
}
|
||||
|
||||
int validate_timestamp_and_record_ex(zend_persistent_script *persistent_script, zend_file_handle *file_handle)
|
||||
{
|
||||
int ret;
|
||||
|
||||
SHM_UNPROTECT();
|
||||
ret = validate_timestamp_and_record(persistent_script, file_handle);
|
||||
SHM_PROTECT();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Instead of resolving full real path name each time we need to identify file,
|
||||
* we create a key that consist from requested file name, current working
|
||||
* directory, current include_path, etc */
|
||||
|
||||
@@ -331,7 +331,6 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason);
|
||||
void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason);
|
||||
accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size);
|
||||
int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
|
||||
int validate_timestamp_and_record_ex(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
|
||||
int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force);
|
||||
int zend_accel_script_optimize(zend_persistent_script *persistent_script);
|
||||
int accelerator_shm_read_lock(void);
|
||||
|
||||
@@ -211,10 +211,8 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
|
||||
*/
|
||||
#if defined(_WIN64)
|
||||
void *vista_mapping_base_set[] = { (void *) 0x0000100000000000, (void *) 0x0000200000000000, (void *) 0x0000300000000000, (void *) 0x0000700000000000, 0 };
|
||||
DWORD size_high = (requested_size >> 32), size_low = (requested_size & 0xffffffff);
|
||||
#else
|
||||
void *vista_mapping_base_set[] = { (void *) 0x20000000, (void *) 0x21000000, (void *) 0x30000000, (void *) 0x31000000, (void *) 0x50000000, 0 };
|
||||
DWORD size_high = 0, size_low = requested_size;
|
||||
#endif
|
||||
void **wanted_mapping_base = default_mapping_base_set;
|
||||
|
||||
@@ -267,7 +265,7 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
|
||||
shared_segment = (zend_shared_segment *)((char *)(*shared_segments_p) + sizeof(void *));
|
||||
(*shared_segments_p)[0] = shared_segment;
|
||||
|
||||
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, size_high, size_low,
|
||||
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, requested_size,
|
||||
create_name_with_username(ACCEL_FILEMAP_NAME));
|
||||
if (memfile == NULL) {
|
||||
err = GetLastError();
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74663 (Segfault with opcache.memory_protect and validate_timestamp)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.enable_file_override=1
|
||||
opcache.validate_timestamps=1
|
||||
opcache.revalidate_freq=0
|
||||
opcache.protect_memory=1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$file = __DIR__ . "/bug74663.inc";
|
||||
file_put_contents($file, "");
|
||||
include $file;
|
||||
|
||||
var_dump(is_file($file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . "/bug74663.inc");
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -341,7 +341,7 @@ static int filename_is_in_cache(zend_string *filename)
|
||||
handle.type = ZEND_HANDLE_FILENAME;
|
||||
|
||||
if (ZCG(accel_directives).validate_timestamps) {
|
||||
return validate_timestamp_and_record_ex(persistent_script, &handle) == SUCCESS;
|
||||
return validate_timestamp_and_record(persistent_script, &handle) == SUCCESS;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
+22
-27
@@ -653,11 +653,6 @@ int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1)
|
||||
{
|
||||
return M_ASN1_STRING_data(asn1);
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
|
||||
|
||||
static int X509_get_signature_nid(const X509 *x)
|
||||
@@ -816,9 +811,9 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
|
||||
}
|
||||
|
||||
for (i = 0; i < X509_NAME_entry_count(name); i++) {
|
||||
const unsigned char *to_add = NULL;
|
||||
unsigned char *to_add = NULL;
|
||||
int to_add_len = 0;
|
||||
unsigned char *to_add_buf = NULL;
|
||||
int needs_free = 0;
|
||||
|
||||
ne = X509_NAME_get_entry(name, i);
|
||||
obj = X509_NAME_ENTRY_get_object(ne);
|
||||
@@ -833,34 +828,32 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
|
||||
str = X509_NAME_ENTRY_get_data(ne);
|
||||
if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) {
|
||||
/* ASN1_STRING_to_UTF8(3): The converted data is copied into a newly allocated buffer */
|
||||
to_add_len = ASN1_STRING_to_UTF8(&to_add_buf, str);
|
||||
to_add = to_add_buf;
|
||||
to_add_len = ASN1_STRING_to_UTF8(&to_add, str);
|
||||
needs_free = 1;
|
||||
} else {
|
||||
/* ASN1_STRING_get0_data(3): Since this is an internal pointer it should not be freed or modified in any way */
|
||||
to_add = ASN1_STRING_get0_data(str);
|
||||
/* ASN1_STRING_data(3): Since this is an internal pointer it should not be freed or modified in any way */
|
||||
to_add = ASN1_STRING_data(str);
|
||||
to_add_len = ASN1_STRING_length(str);
|
||||
}
|
||||
|
||||
if (to_add_len != -1) {
|
||||
if ((data = zend_hash_str_find(Z_ARRVAL(subitem), sname, strlen(sname))) != NULL) {
|
||||
if (Z_TYPE_P(data) == IS_ARRAY) {
|
||||
add_next_index_stringl(data, (const char *)to_add, to_add_len);
|
||||
add_next_index_stringl(data, (char *)to_add, to_add_len);
|
||||
} else if (Z_TYPE_P(data) == IS_STRING) {
|
||||
array_init(&tmp);
|
||||
add_next_index_str(&tmp, zend_string_copy(Z_STR_P(data)));
|
||||
add_next_index_stringl(&tmp, (const char *)to_add, to_add_len);
|
||||
add_next_index_stringl(&tmp, (char *)to_add, to_add_len);
|
||||
zend_hash_str_update(Z_ARRVAL(subitem), sname, strlen(sname), &tmp);
|
||||
}
|
||||
} else {
|
||||
/* it might be better to expand it and pass zval from ZVAL_STRING
|
||||
* to zend_symtable_str_update so we do not silently drop const
|
||||
* but we need a test to cover this part first */
|
||||
add_assoc_stringl(&subitem, sname, (char *)to_add, to_add_len);
|
||||
}
|
||||
}
|
||||
|
||||
if (to_add_buf != NULL) {
|
||||
OPENSSL_free(to_add_buf);
|
||||
if (needs_free) {
|
||||
/* ASN1_STRING_to_UTF8(3): The buffer out should be freed using free(3) */
|
||||
OPENSSL_free(to_add);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -899,7 +892,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
|
||||
|
||||
timestr_len = (size_t)ASN1_STRING_length(timestr);
|
||||
|
||||
if (timestr_len != strlen((const char *)ASN1_STRING_get0_data(timestr))) {
|
||||
if (timestr_len != strlen((const char*)ASN1_STRING_data(timestr))) {
|
||||
php_error_docref(NULL, E_WARNING, "illegal length in timestamp");
|
||||
return (time_t)-1;
|
||||
}
|
||||
@@ -914,7 +907,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
|
||||
return (time_t)-1;
|
||||
}
|
||||
|
||||
strbuf = estrdup((const char *)ASN1_STRING_get0_data(timestr));
|
||||
strbuf = estrdup((char *)ASN1_STRING_data(timestr));
|
||||
|
||||
memset(&thetime, 0, sizeof(thetime));
|
||||
|
||||
@@ -1760,19 +1753,21 @@ PHP_FUNCTION(openssl_spki_new)
|
||||
s = zend_string_alloc(strlen(spkac) + strlen(spkstr), 0);
|
||||
sprintf(ZSTR_VAL(s), "%s%s", spkac, spkstr);
|
||||
ZSTR_LEN(s) = strlen(ZSTR_VAL(s));
|
||||
OPENSSL_free(spkstr);
|
||||
|
||||
RETVAL_STR(s);
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
|
||||
if (spki != NULL) {
|
||||
if (keyresource == NULL && spki != NULL) {
|
||||
NETSCAPE_SPKI_free(spki);
|
||||
}
|
||||
if (keyresource == NULL && pkey != NULL) {
|
||||
EVP_PKEY_free(pkey);
|
||||
}
|
||||
if (keyresource == NULL && spkstr != NULL) {
|
||||
efree(spkstr);
|
||||
}
|
||||
|
||||
if (s && ZSTR_LEN(s) <= 0) {
|
||||
RETVAL_FALSE;
|
||||
@@ -1950,7 +1945,7 @@ PHP_FUNCTION(openssl_spki_export_challenge)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
RETVAL_STRING((const char *)ASN1_STRING_get0_data(spki->spkac->challenge));
|
||||
RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge));
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
@@ -2131,19 +2126,19 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension)
|
||||
case GEN_EMAIL:
|
||||
BIO_puts(bio, "email:");
|
||||
as = name->d.rfc822Name;
|
||||
BIO_write(bio, ASN1_STRING_get0_data(as),
|
||||
BIO_write(bio, ASN1_STRING_data(as),
|
||||
ASN1_STRING_length(as));
|
||||
break;
|
||||
case GEN_DNS:
|
||||
BIO_puts(bio, "DNS:");
|
||||
as = name->d.dNSName;
|
||||
BIO_write(bio, ASN1_STRING_get0_data(as),
|
||||
BIO_write(bio, ASN1_STRING_data(as),
|
||||
ASN1_STRING_length(as));
|
||||
break;
|
||||
case GEN_URI:
|
||||
BIO_puts(bio, "URI:");
|
||||
as = name->d.uniformResourceIdentifier;
|
||||
BIO_write(bio, ASN1_STRING_get0_data(as),
|
||||
BIO_write(bio, ASN1_STRING_data(as),
|
||||
ASN1_STRING_length(as));
|
||||
break;
|
||||
default:
|
||||
@@ -5421,7 +5416,7 @@ PHP_FUNCTION(openssl_seal)
|
||||
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(ctx));
|
||||
EVP_CIPHER_CTX_cleanup(ctx);
|
||||
|
||||
if (EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) <= 0 ||
|
||||
if (!EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) ||
|
||||
!EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, (int)data_len) ||
|
||||
!EVP_SealFinal(ctx, buf + len1, &len2)) {
|
||||
RETVAL_FALSE;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEoDCCBAmgAwIBAgIBJzANBgkqhkiG9w0BAQQFADCBkDELMAkGA1UEFhMCUk8x
|
||||
EDAOBgNVBAgTB1JvbWFuaWExEDAOBgNVBAcTB0NyYWlvdmExDzANBgNVBAoTBlNl
|
||||
cmdpdTETMBEGA1UECxMKU2VyZ2l1IFNSTDESMBAGA1UEAxMJU2VyZ2l1IENBMSMw
|
||||
IQYJKoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTAeFw0wNDA1MTQxMzM0
|
||||
NTZaFw0wNTA1MTQxMzM0NTZaMIGaMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9t
|
||||
YW5pYTEQMA4GA1UEBxMHQ3JhaW92YTETMBEGA1UEChMKU2VyZ2l1IFNSTDETMBEG
|
||||
A1UECxMKU2VyZ2l1IFNSTDEYMBYGA1UEAxMPU2VyZ2l1IHBlcnNvbmFsMSMwIQYJ
|
||||
KoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEF
|
||||
AAOBjQAwgYkCgYEApNj7XXz8T8FcLIWpBniPYom3QcT6T7u0xRPHqtqzj5oboBYp
|
||||
DJe5d354/y0gJTpiLt8+fTrPgWXnbHm3pOHgXzTcX6Arani0GDU0/xDi4VkCRGcS
|
||||
YqX2sJpcDzAbmK9UDMt3xf/O1B8AJan3RfO0Bm3ozTEPziLMkmsiYr5b/L4CAwEA
|
||||
AaOCAfwwggH4MAkGA1UdEwQCMAAwNQYJYIZIAYb4QgENBCgWJkZvciBHcmlkIHVz
|
||||
ZSBvbmx5OyByZXF1ZXN0IHRhZyB1c2VyVGFnMBEGCWCGSAGG+EIBAQQEAwIF4DA/
|
||||
BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vbW9iaWxlLmJsdWUtc29mdHdhcmUucm86
|
||||
OTAvY2EvY3JsLnNodG1sMDUGCWCGSAGG+EIBCAQoFiZodHRwOi8vbW9iaWxlLmJs
|
||||
dWUtc29mdHdhcmUucm86OTAvcHViLzAhBgNVHREEGjAYgRZzZXJnaXVAYmx1ZXNv
|
||||
ZnR3YXJlLnJvMB0GA1UdDgQWBBSwp//5QRXeIzm93TEPl6CyonTg/DCBpwYDVR0j
|
||||
BIGfMIGcoYGWpIGTMIGQMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9tYW5pYTEQ
|
||||
MA4GA1UEBxMHQ3JhaW92YTEPMA0GA1UEChMGU2VyZ2l1MRMwEQYDVQQLEwpTZXJn
|
||||
aXUgU1JMMRIwEAYDVQQDEwlTZXJnaXUgQ0ExIzAhBgkqhkiG9w0BCQEWFG5fc2Vy
|
||||
Z2l1QGhvdG1haWwuY29tggEAMAsGA1UdDwQEAwIE8DAjBglghkgBhvhCAQIEFhYU
|
||||
aHR0cDovLzYyLjIzMS45OC41Mi8wCwYDKgMEBAQ+52I0MA0GCSqGSIb3DQEBBAUA
|
||||
A4GBAIBIOJ+iiLyQfNJEY+IMefayQea0nmuXYY+F+L1DFjSC7xChytgYoPNnKkhh
|
||||
3dWPtxbswiqKYUnGi6y3Hi4UhDsOaDW29t2S305hSc2qgjOiNtRYQIVYQ8EHG1k7
|
||||
Fl63S7uCOhnVJt+4MnUK1N6/pwgsp+Z2GvEsDG1qCKnvNpf6
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74651: negative-size-param (-1) in memcpy in zif_openssl_seal()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$inputstr = file_get_contents(__DIR__ . "/74651.pem");
|
||||
$pub_key_id = openssl_get_publickey($inputstr);
|
||||
var_dump($pub_key_id);
|
||||
var_dump(openssl_seal($inputstr, $sealed, $ekeys, array($pub_key_id, $pub_key_id), 'AES-128-ECB'));
|
||||
?>
|
||||
--EXPECTF--
|
||||
resource(%d) of type (OpenSSL key)
|
||||
bool(false)
|
||||
@@ -1,55 +0,0 @@
|
||||
--TEST--
|
||||
openssl_pkcs12_export() tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("openssl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cert_file = dirname(__FILE__) . "/public.crt";
|
||||
$cert = file_get_contents($cert_file);
|
||||
$cert_path = "file://" . $cert_file;
|
||||
$priv_file = dirname(__FILE__) . "/private.crt";
|
||||
$priv = file_get_contents($priv_file);
|
||||
$priv_path = "file://" . $priv_file;
|
||||
$cert_res = openssl_x509_read($cert);
|
||||
$priv_res = openssl_pkey_get_private($priv);
|
||||
$pass = "test";
|
||||
$invalid = "";
|
||||
$invalid_path = "file:///tmp/php";
|
||||
$opts = [];
|
||||
|
||||
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass)); // read certs as a string
|
||||
var_dump(openssl_pkcs12_read($output, $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export($cert_path, $output, $priv_path, $pass)); // read certs from a filename string
|
||||
var_dump(openssl_pkcs12_read($output, $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export($cert_res, $output, $priv_res, $pass)); // read certs from a resource
|
||||
var_dump(openssl_pkcs12_read($output, $opts, $pass));
|
||||
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array($cert))); // extra optional cert
|
||||
var_dump(openssl_pkcs12_read($output, $opts, $pass));
|
||||
//var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert
|
||||
|
||||
|
||||
var_dump(openssl_pkcs12_export($invalid, $output, $invalid, $pass));
|
||||
var_dump(openssl_pkcs12_export($invalid_path, $output, $invalid_path, $pass));
|
||||
var_dump(openssl_pkcs12_export($priv_res, $output, $cert_res, $pass));
|
||||
//var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array("foo")));
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: openssl_pkcs12_export(): supplied resource is not a valid OpenSSL X.509 resource in %s on line %d
|
||||
|
||||
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,97 +0,0 @@
|
||||
--TEST--
|
||||
openssl_pkcs12_read() tests
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("openssl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$p12_file = dirname(__FILE__) . "/p12_with_extra_certs.p12";
|
||||
$p12 = file_get_contents($p12_file);
|
||||
$certs = array();
|
||||
$pass = "qwerty";
|
||||
|
||||
var_dump(openssl_pkcs12_read("", $certs, ""));
|
||||
var_dump(openssl_pkcs12_read($p12, $certs, ""));
|
||||
var_dump(openssl_pkcs12_read($p12, $certs, $pass));
|
||||
var_dump($certs);
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
array(3) {
|
||||
["cert"]=>
|
||||
string(1111) "-----BEGIN CERTIFICATE-----
|
||||
MIIDBjCCAe4CCQCS/had1ITjDjANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJQ
|
||||
TDETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
|
||||
cyBQdHkgTHRkMB4XDTE1MDYxMDEyMTI0N1oXDTE2MDYwOTEyMTI0N1owRTELMAkG
|
||||
A1UEBhMCUEwxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
|
||||
IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
|
||||
ANHezJRoGMbtDzSwK7WPjj6+Yhj7R9LJyR7TjvxH01ZVA+sHUrcXs3tDXukIQcH1
|
||||
rsnf4WbBjGbQT3jlLicsll6gMOh8oaCdi6863cvw1XRUmlezpAs2V5MZOEgqkWvU
|
||||
8OKHqjt8o9F07T3n1zYeeBjiUsr6UWqX4+Znwa25UF0Fid1R4BxmX7GpDoq0Weuv
|
||||
WQafbM9qs3Qrd7Ea3Lqz9pGkWx1BmOv49XorAhQadxCT32GbUdhmhxgrDgyW5M7m
|
||||
ECz4DngZLhZvLC8Juf/Q6R5SjhN5/f/TBq//QpKaCjBAamhZDJtWMv80IDKJO7Ir
|
||||
fQMnPEq4vCnHdKvG7N6ZjsECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAHGAiEN0o
|
||||
tOV2tbK0Qm/mWlyuRKtxqnP3y/2Q5SFMmRpkOS54hFf9YBNgT7nWK3Z5fPKor17t
|
||||
rGthXPSZU8hxY5iHFhELurp23qGmJftdcYL2mF7IyoGOiZ1Q6Vt9LnRTDtgrHh/f
|
||||
ZziI+gaPpmAfEAh48xQrlviHqaR9F63d0UN1jz9cF1kIj1H21PAGC0tmAIxxb4ee
|
||||
hjipL+JLH0iRoBQE83cF2BOQCfRzRekotnDYon6v7mTjYu7kwl8paRIEMNrBckby
|
||||
IL3CJOZFesaFO7suK7oP7r6BIATpVcg2m0V25mVMVFRm4F/JOvSkB381Pte/Ccuv
|
||||
dxPWHER13ptIVg==
|
||||
-----END CERTIFICATE-----
|
||||
"
|
||||
["pkey"]=>
|
||||
string(1704) "-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDR3syUaBjG7Q80
|
||||
sCu1j44+vmIY+0fSycke0478R9NWVQPrB1K3F7N7Q17pCEHB9a7J3+FmwYxm0E94
|
||||
5S4nLJZeoDDofKGgnYuvOt3L8NV0VJpXs6QLNleTGThIKpFr1PDih6o7fKPRdO09
|
||||
59c2HngY4lLK+lFql+PmZ8GtuVBdBYndUeAcZl+xqQ6KtFnrr1kGn2zParN0K3ex
|
||||
Gty6s/aRpFsdQZjr+PV6KwIUGncQk99hm1HYZocYKw4MluTO5hAs+A54GS4Wbywv
|
||||
Cbn/0OkeUo4Tef3/0wav/0KSmgowQGpoWQybVjL/NCAyiTuyK30DJzxKuLwpx3Sr
|
||||
xuzemY7BAgMBAAECggEAbdYX5ZexV/LbYWzOA2CVRnsnJgHkrgnTS2HXVGtWzLkD
|
||||
qu6TOKWb1mgE9RrQJ22oQ5j7A2dKTsi4vwHarL/mFrHpxtLrV/78CwJY8BIj9JUO
|
||||
jdXDheaz4JVzYjl9EB1K0JPF4QozRjzWqO58MKOzoPpZ8EcfcxT5Pi2RLJVu3K9F
|
||||
DR3cUNa9h66j84sDJARzvxMfgR6VysHVmgN1aR78Mye0dFVYeL7wCXFJmJXa2AYw
|
||||
TQR5FcFRa0h8t40EOJdXcoWu63TUd7rvDgebHXJeKax8W2pGREHZfeEw5wWpFQn8
|
||||
j+znHSISe7eM9wmW6ombab7zcJsCwXDYgtY/6OqRAQKBgQD6EXKfXThfnrN/od/Y
|
||||
jF8mfKdJ67HOc8WVPlB9vHDsduFyX914ahJHeCVQPkV1a2nx+bv3PviWbrKreEKl
|
||||
b7aAAAkbxy/FakcxE9b0wC5JsSW9vByXQiRn0iDqDNl9iwzX/LLW6wE7SruCPp+z
|
||||
mzCHArp6mvJmRFooR8e3IXiA0QKBgQDW2T9xXFBpumSOBRpn7Zc9SGiQ9qZTSKKb
|
||||
boVSDd2cod8O1aow3gnQNid/cNnt54Yh5Z3KlYfFWkmrV+0/yQZ/SThZ1uHAaZVy
|
||||
OnWKVELykpYLnKGlHoQpOYTCfdYan5xOfkw55em3TTeQq5tETYWMdhS/9VVxeLKZ
|
||||
k2xr+CYq8QKBgQCzHpJK4nwByexq7KkpNIrnR3yQb1oiNjz9xO/k0HjWd+TOhypd
|
||||
GSVUuhOIIcKg87qkj6x60kk/f7VNK0wZsiY4E05y7j8imhi6Z6qeD5ZYRKJzAG4+
|
||||
TitDjnjzDRcwXMxrXV9AoH52WPZsuays+ulMm8C1F42vgSBPH/NHEpt9MQKBgAIw
|
||||
nLDvG/K376Zy7t34Uf5R6p7vpKpcpyumaL15XrTmAXwJOX7eBIOWybhG0jHWlktq
|
||||
J72U4JlmXjHc55Iq3mIVwPlJc2uep+NOLTyHt1b5n4Xmxs8EDJzO9Ud2OOR0lAdI
|
||||
ykYczdEMfHCBD0gW8jGIUpXSTlilvkxKcGR5VwpBAoGBANdAWL3lw+/P43x6Rxth
|
||||
GJN8QzWe5vRFJYS5mkeaa/6jrFrsvk176WudopropFGtRc/44E1IDOZULJM80Xgb
|
||||
JTeUFyb+ZjYLrHUp1yir+oZIm5DBZDZjYclanrPPHg9YwVxcHtunPeCFy3iC+W+F
|
||||
MK80GEnRQIkB7uZVk+r0HusK
|
||||
-----END PRIVATE KEY-----
|
||||
"
|
||||
["extracerts"]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1111) "-----BEGIN CERTIFICATE-----
|
||||
MIIDBjCCAe4CCQDaL5/+UVeXuTANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB
|
||||
VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
|
||||
cyBQdHkgTHRkMB4XDTE1MDYxMDEyNDAwNVoXDTE2MDYwOTEyNDAwNVowRTELMAkG
|
||||
A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
|
||||
IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
|
||||
AL/IF7bW0vpEg5A054SDqTi5pkSeie6nyIT77qCAVI5PMlhNjxuqDIlLpCWonvKb
|
||||
LMRtp7t24BsQBRgQgps8mtfRr0gV1qq9HMfDj2bZdGcTShZN/M/BFATwxaNRTHl9
|
||||
ey8zxGcLd4aFFBlVhXHYdBXg/PG/oxJMAFuMwa+KxSP6Mqp1FlOZtvUUieQcToMf
|
||||
Mh8Lbr4g/yHFj5lgWIJ2fmJjHJZ4wf9QBeGUrVqqxzSDEL9f0PGy+grqSHoIzLr3
|
||||
+uhvhoI85nCyZs9+lrELuQKqbiZ8Q6Vmj6JGt3miNBFVTbBpP9GK8sVuVQwgqd8p
|
||||
C3e8hHqv7vwF+s0zjiZ+rCcCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAdpTtiyDJ
|
||||
0wLB18iunXCMUJpjc/HVYEp5P9vl2E/bcZfGns/8KxNHoe9mgJycr3mwjCjMjVx2
|
||||
L/9q/8XoT02aBncwAx4oZ2H0qfjZppaUSnSc1Uv+dsldDC2mZvJgwXN7jtQmU5P3
|
||||
cspFHuJoYK8AqYJqlO6E4L9uRF7dLEliUnrBpF4BxziwskTquRX+zgD+fmk0L5O8
|
||||
qqvm8btWCxfng+qD7UHFWbUQ2IegZ3VrBWJ2XsxOvokMM4HoHVb0BZgq8Dvu0XJ9
|
||||
EriEQkcydtrRKtlcWHLKcJuNUnkw2qfj+F8mmdaZib8Apa1UCkt0ZlpyYO3V2ejY
|
||||
WIjafwJYrv6f5g==
|
||||
-----END CERTIFICATE-----
|
||||
"
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDR3syUaBjG7Q80
|
||||
sCu1j44+vmIY+0fSycke0478R9NWVQPrB1K3F7N7Q17pCEHB9a7J3+FmwYxm0E94
|
||||
5S4nLJZeoDDofKGgnYuvOt3L8NV0VJpXs6QLNleTGThIKpFr1PDih6o7fKPRdO09
|
||||
59c2HngY4lLK+lFql+PmZ8GtuVBdBYndUeAcZl+xqQ6KtFnrr1kGn2zParN0K3ex
|
||||
Gty6s/aRpFsdQZjr+PV6KwIUGncQk99hm1HYZocYKw4MluTO5hAs+A54GS4Wbywv
|
||||
Cbn/0OkeUo4Tef3/0wav/0KSmgowQGpoWQybVjL/NCAyiTuyK30DJzxKuLwpx3Sr
|
||||
xuzemY7BAgMBAAECggEAbdYX5ZexV/LbYWzOA2CVRnsnJgHkrgnTS2HXVGtWzLkD
|
||||
qu6TOKWb1mgE9RrQJ22oQ5j7A2dKTsi4vwHarL/mFrHpxtLrV/78CwJY8BIj9JUO
|
||||
jdXDheaz4JVzYjl9EB1K0JPF4QozRjzWqO58MKOzoPpZ8EcfcxT5Pi2RLJVu3K9F
|
||||
DR3cUNa9h66j84sDJARzvxMfgR6VysHVmgN1aR78Mye0dFVYeL7wCXFJmJXa2AYw
|
||||
TQR5FcFRa0h8t40EOJdXcoWu63TUd7rvDgebHXJeKax8W2pGREHZfeEw5wWpFQn8
|
||||
j+znHSISe7eM9wmW6ombab7zcJsCwXDYgtY/6OqRAQKBgQD6EXKfXThfnrN/od/Y
|
||||
jF8mfKdJ67HOc8WVPlB9vHDsduFyX914ahJHeCVQPkV1a2nx+bv3PviWbrKreEKl
|
||||
b7aAAAkbxy/FakcxE9b0wC5JsSW9vByXQiRn0iDqDNl9iwzX/LLW6wE7SruCPp+z
|
||||
mzCHArp6mvJmRFooR8e3IXiA0QKBgQDW2T9xXFBpumSOBRpn7Zc9SGiQ9qZTSKKb
|
||||
boVSDd2cod8O1aow3gnQNid/cNnt54Yh5Z3KlYfFWkmrV+0/yQZ/SThZ1uHAaZVy
|
||||
OnWKVELykpYLnKGlHoQpOYTCfdYan5xOfkw55em3TTeQq5tETYWMdhS/9VVxeLKZ
|
||||
k2xr+CYq8QKBgQCzHpJK4nwByexq7KkpNIrnR3yQb1oiNjz9xO/k0HjWd+TOhypd
|
||||
GSVUuhOIIcKg87qkj6x60kk/f7VNK0wZsiY4E05y7j8imhi6Z6qeD5ZYRKJzAG4+
|
||||
TitDjnjzDRcwXMxrXV9AoH52WPZsuays+ulMm8C1F42vgSBPH/NHEpt9MQKBgAIw
|
||||
nLDvG/K376Zy7t34Uf5R6p7vpKpcpyumaL15XrTmAXwJOX7eBIOWybhG0jHWlktq
|
||||
J72U4JlmXjHc55Iq3mIVwPlJc2uep+NOLTyHt1b5n4Xmxs8EDJzO9Ud2OOR0lAdI
|
||||
ykYczdEMfHCBD0gW8jGIUpXSTlilvkxKcGR5VwpBAoGBANdAWL3lw+/P43x6Rxth
|
||||
GJN8QzWe5vRFJYS5mkeaa/6jrFrsvk176WudopropFGtRc/44E1IDOZULJM80Xgb
|
||||
JTeUFyb+ZjYLrHUp1yir+oZIm5DBZDZjYclanrPPHg9YwVxcHtunPeCFy3iC+W+F
|
||||
MK80GEnRQIkB7uZVk+r0HusK
|
||||
-----END PRIVATE KEY-----
|
||||
@@ -1,23 +0,0 @@
|
||||
Bag Attributes
|
||||
localKeyID: E1 BC BF 63 1E 2A A4 F6 4C 71 6B E7 CE E2 6D 4A 95 CD 26 5B
|
||||
subject=/C=PL/ST=Some-State/O=Internet Widgits Pty Ltd
|
||||
issuer=/C=PL/ST=Some-State/O=Internet Widgits Pty Ltd
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDBjCCAe4CCQCS/had1ITjDjANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJQ
|
||||
TDETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
|
||||
cyBQdHkgTHRkMB4XDTE1MDYxMDEyMTI0N1oXDTE2MDYwOTEyMTI0N1owRTELMAkG
|
||||
A1UEBhMCUEwxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
|
||||
IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
|
||||
ANHezJRoGMbtDzSwK7WPjj6+Yhj7R9LJyR7TjvxH01ZVA+sHUrcXs3tDXukIQcH1
|
||||
rsnf4WbBjGbQT3jlLicsll6gMOh8oaCdi6863cvw1XRUmlezpAs2V5MZOEgqkWvU
|
||||
8OKHqjt8o9F07T3n1zYeeBjiUsr6UWqX4+Znwa25UF0Fid1R4BxmX7GpDoq0Weuv
|
||||
WQafbM9qs3Qrd7Ea3Lqz9pGkWx1BmOv49XorAhQadxCT32GbUdhmhxgrDgyW5M7m
|
||||
ECz4DngZLhZvLC8Juf/Q6R5SjhN5/f/TBq//QpKaCjBAamhZDJtWMv80IDKJO7Ir
|
||||
fQMnPEq4vCnHdKvG7N6ZjsECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAHGAiEN0o
|
||||
tOV2tbK0Qm/mWlyuRKtxqnP3y/2Q5SFMmRpkOS54hFf9YBNgT7nWK3Z5fPKor17t
|
||||
rGthXPSZU8hxY5iHFhELurp23qGmJftdcYL2mF7IyoGOiZ1Q6Vt9LnRTDtgrHh/f
|
||||
ZziI+gaPpmAfEAh48xQrlviHqaR9F63d0UN1jz9cF1kIj1H21PAGC0tmAIxxb4ee
|
||||
hjipL+JLH0iRoBQE83cF2BOQCfRzRekotnDYon6v7mTjYu7kwl8paRIEMNrBckby
|
||||
IL3CJOZFesaFO7suK7oP7r6BIATpVcg2m0V25mVMVFRm4F/JOvSkB381Pte/Ccuv
|
||||
dxPWHER13ptIVg==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -7307,7 +7307,7 @@ if (opcode == OP_COND || opcode == OP_SCOND)
|
||||
|
||||
if (*matchingpath == OP_FAIL)
|
||||
stacksize = 0;
|
||||
else if (*matchingpath == OP_RREF)
|
||||
if (*matchingpath == OP_RREF)
|
||||
{
|
||||
stacksize = GET2(matchingpath, 1);
|
||||
if (common->currententry == NULL)
|
||||
|
||||
+13
-27
@@ -2,31 +2,16 @@ dnl $Id$
|
||||
dnl config.m4 for extension pdo_oci
|
||||
dnl vim:et:sw=2:ts=2:
|
||||
|
||||
if test -z "$SED"; then
|
||||
PHP_PDO_OCI_SED="sed";
|
||||
else
|
||||
PHP_PDO_OCI_SED="$SED";
|
||||
fi
|
||||
|
||||
PHP_PDO_OCI_TAIL1=`echo a | tail -n1 2>/dev/null`
|
||||
if test "$PHP_PDO_OCI_TAIL1" = "a"; then
|
||||
PHP_PDO_OCI_TAIL1="tail -n1"
|
||||
else
|
||||
PHP_PDO_OCI_TAIL1="tail -1"
|
||||
fi
|
||||
|
||||
SUPPORTED_LIB_VERS="9.0 10.1 11.1 12.1" # The lib vers are not bumped when the DB version is bumped
|
||||
AC_DEFUN([AC_PDO_OCI_VERSION],[
|
||||
AC_MSG_CHECKING([Oracle version])
|
||||
PDO_OCI_LCS_BASE=$PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME
|
||||
PDO_OCI_LCS=`ls $PDO_OCI_LCS_BASE.*.1 2> /dev/null | $PHP_PDO_OCI_TAIL1` # Oracle 10g, 11g, 12c etc
|
||||
if test -f "$PDO_OCI_LCS"; then
|
||||
dnl Oracle 10g, 11g 12c etc. The x.2 version libraries are named x.1 for drop in compatibility
|
||||
PDO_OCI_VERSION=`echo $PDO_OCI_LCS | $PHP_PDO_OCI_SED -e 's/.*\.\(.*\)\.1$/\1.1/'`
|
||||
elif test -f $PDO_OCI_LCS_BASE.9.0; then
|
||||
dnl There is no case for Oracle 9.2. Oracle 9.2 libraries have a 9.0 suffix for drop-in compatibility with Oracle 9.0
|
||||
PDO_OCI_VERSION=9.0
|
||||
else
|
||||
AC_MSG_ERROR(Oracle libclntsh.$SHLIB_SUFFIX_NAME client library not found or its version is lower than 9)
|
||||
for OCI_VER in $SUPPORTED_LIB_VERS; do
|
||||
if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then
|
||||
PDO_OCI_VERSION="$OCI_VER"
|
||||
fi
|
||||
done
|
||||
if test -z "$PDO_OCI_VERSION"; then
|
||||
AC_MSG_ERROR([Oracle required OCI8 libraries not found under $PDO_OCI_DIR])
|
||||
fi
|
||||
AC_MSG_RESULT($PDO_OCI_VERSION)
|
||||
])
|
||||
@@ -162,12 +147,13 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
|
||||
fi
|
||||
|
||||
case $PDO_OCI_VERSION in
|
||||
7.3|8.0|8.1)
|
||||
AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
|
||||
;;
|
||||
*)
|
||||
9.0|10.1|10.2|11.1|11.2|12.1)
|
||||
PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
|
||||
;;
|
||||
esac
|
||||
|
||||
PHP_ADD_LIBPATH($PDO_OCI_LIB_DIR, PDO_OCI_SHARED_LIBADD)
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
--TEST--
|
||||
PDO OCI Bug #60994 (Reading a multibyte CLOB caps at 8192 characters)
|
||||
--CREDITS--
|
||||
Chuck Burgess
|
||||
ashnazg@php.net
|
||||
--SKIPIF--
|
||||
<?php
|
||||
/* $Id$ */
|
||||
if (!extension_loaded('mbstring') || !extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
|
||||
require dirname(__FILE__).'/../../pdo/tests/pdo_test.inc';
|
||||
if (!strpos(strtolower(getenv('PDOTEST_DSN')), 'charset=al32utf8')) die('skip expected output valid for AL32UTF8 character set');
|
||||
PDOTest::skip();
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'ext/pdo/tests/pdo_test.inc';
|
||||
$dbh = PDOTest::factory();
|
||||
$dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);
|
||||
$dbh->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
|
||||
|
||||
@$dbh->exec('DROP TABLE pdo_oci_bug60994');
|
||||
$dbh->exec('CREATE TABLE pdo_oci_bug60994 (id NUMBER, data CLOB)');
|
||||
|
||||
$id = null;
|
||||
$insert = $dbh->prepare('INSERT INTO pdo_oci_bug60994 (id, data) VALUES (:id, :data)');
|
||||
$insert->bindParam(':id', $id, \PDO::PARAM_STR);
|
||||
$select = $dbh->prepare("SELECT data FROM pdo_oci_bug60994 WHERE id = :id");
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 1: j', PHP_EOL;
|
||||
$string1 = 'abc' . str_repeat('j', 8187) . 'xyz'; // 8193 chars total works fine here (even 1 million works fine, subject to memory_limit)
|
||||
$id = 1;
|
||||
$insert->bindParam(':data', $string1, \PDO::PARAM_STR, strlen($string1)); // length in bytes
|
||||
$insert->execute();
|
||||
$select->bindParam(':id', $id, \PDO::PARAM_STR);
|
||||
$select->execute();
|
||||
$row = $select->fetch();
|
||||
$stream1 = stream_get_contents($row['DATA']);
|
||||
$start1 = mb_substr($stream1, 0, 10);
|
||||
$ending1 = mb_substr($stream1, -10);
|
||||
echo 'size of string1 is ', strlen($string1), ' bytes, ', mb_strlen($string1), ' chars.', PHP_EOL;
|
||||
echo 'size of stream1 is ', strlen($stream1), ' bytes, ', mb_strlen($stream1), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream1 is ', $start1, PHP_EOL;
|
||||
echo 'end of stream1 is ', $ending1, PHP_EOL;
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 2: £', PHP_EOL;
|
||||
$string2 = 'abc' . str_repeat('£', 8187) . 'xyz'; // 8193 chars total is when it breaks
|
||||
$id = 2;
|
||||
$insert->bindParam(':data', $string2, \PDO::PARAM_STR, strlen($string2)); // length in bytes
|
||||
$insert->execute();
|
||||
$select->bindParam(':id', $id, \PDO::PARAM_STR);
|
||||
$select->execute();
|
||||
$row = $select->fetch();
|
||||
$stream2 = stream_get_contents($row['DATA']);
|
||||
$start2 = mb_substr($stream2, 0, 10);
|
||||
$ending2 = mb_substr($stream2, -10);
|
||||
echo 'size of string2 is ', strlen($string2), ' bytes, ', mb_strlen($string2), ' chars.', PHP_EOL;
|
||||
echo 'size of stream2 is ', strlen($stream2), ' bytes, ', mb_strlen($stream2), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream2 is ', $start2, PHP_EOL;
|
||||
echo 'end of stream2 is ', $ending2, PHP_EOL;
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 3: Җ', PHP_EOL;
|
||||
$string3 = 'abc' . str_repeat('Җ', 8187) . 'xyz'; // 8193 chars total is when it breaks
|
||||
$id = 3;
|
||||
$insert->bindParam(':data', $string3, \PDO::PARAM_STR, strlen($string3)); // length in bytes
|
||||
$insert->execute();
|
||||
$select->bindParam(':id', $id, \PDO::PARAM_STR);
|
||||
$select->execute();
|
||||
$row = $select->fetch();
|
||||
$stream3 = stream_get_contents($row['DATA']);
|
||||
$start3 = mb_substr($stream3, 0, 10);
|
||||
$ending3 = mb_substr($stream3, -10);
|
||||
echo 'size of string3 is ', strlen($string3), ' bytes, ', mb_strlen($string3), ' chars.', PHP_EOL;
|
||||
echo 'size of stream3 is ', strlen($stream3), ' bytes, ', mb_strlen($stream3), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream3 is ', $start3, PHP_EOL;
|
||||
echo 'end of stream3 is ', $ending3, PHP_EOL;
|
||||
|
||||
|
||||
echo PHP_EOL, 'Test 4: の', PHP_EOL;
|
||||
$string4 = 'abc' . str_repeat('の', 8187) . 'xyz'; // 8193 chars total is when it breaks
|
||||
$id = 4;
|
||||
$insert->bindParam(':data', $string4, \PDO::PARAM_STR, strlen($string4)); // length in bytes
|
||||
$insert->execute();
|
||||
$select->bindParam(':id', $id, \PDO::PARAM_STR);
|
||||
$select->execute();
|
||||
$row = $select->fetch();
|
||||
$stream4 = stream_get_contents($row['DATA']);
|
||||
$start4 = mb_substr($stream4, 0, 10);
|
||||
$ending4 = mb_substr($stream4, -10);
|
||||
echo 'size of string4 is ', strlen($string4), ' bytes, ', mb_strlen($string4), ' chars.', PHP_EOL;
|
||||
echo 'size of stream4 is ', strlen($stream4), ' bytes, ', mb_strlen($stream4), ' chars.', PHP_EOL;
|
||||
echo 'beg of stream4 is ', $start4, PHP_EOL;
|
||||
echo 'end of stream4 is ', $ending4, PHP_EOL;
|
||||
|
||||
--XFAIL--
|
||||
Fails due to Bug 60994
|
||||
--EXPECTF--
|
||||
|
||||
Test 1: j
|
||||
size of string1 is 1000006 bytes, 1000006 chars.
|
||||
size of stream1 is 1000006 bytes, 1000006 chars.
|
||||
beg of stream1 is abcjjjjjjj
|
||||
end of stream1 is jjjjjjjxyz
|
||||
|
||||
Test 2: £
|
||||
size of string2 is 16380 bytes, 8193 chars.
|
||||
size of stream2 is 16380 bytes, 8193 chars.
|
||||
beg of stream2 is abc£££££££
|
||||
end of stream2 is £££££££xyz
|
||||
|
||||
Test 3: Җ
|
||||
size of string3 is 16380 bytes, 8193 chars.
|
||||
size of stream3 is 16380 bytes, 8193 chars.
|
||||
beg of stream3 is abcҖҖҖҖҖҖҖ
|
||||
end of stream3 is ҖҖҖҖҖҖҖxyz
|
||||
|
||||
Test 4: の
|
||||
size of string4 is 24567 bytes, 8193 chars.
|
||||
size of stream4 is 24567 bytes, 8193 chars.
|
||||
beg of stream4 is abcののののののの
|
||||
end of stream4 is のののののののxyz
|
||||
|
||||
+2
-74
@@ -5149,6 +5149,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phar___construct, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, filename)
|
||||
ZEND_ARG_INFO(0, flags)
|
||||
ZEND_ARG_INFO(0, alias)
|
||||
ZEND_ARG_INFO(0, fileformat)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
PHAR_ARG_INFO
|
||||
@@ -5396,79 +5397,6 @@ zend_function_entry php_archive_methods[] = {
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
PHAR_ARG_INFO
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_data___construct, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, filename)
|
||||
ZEND_ARG_INFO(0, flags)
|
||||
ZEND_ARG_INFO(0, alias)
|
||||
ZEND_ARG_INFO(0, fileformat)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
zend_function_entry php_data_methods[] = {
|
||||
#if !HAVE_SPL
|
||||
PHP_ME(Phar, __construct, arginfo_data___construct, ZEND_ACC_PRIVATE)
|
||||
#else
|
||||
PHP_ME(Phar, __construct, arginfo_data___construct, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, __destruct, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, addEmptyDir, arginfo_phar_emptydir, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, addFile, arginfo_phar_addfile, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, addFromString, arginfo_phar_fromstring, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, buildFromDirectory, arginfo_phar_fromdir, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, buildFromIterator, arginfo_phar_build, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, compressFiles, arginfo_phar_comp, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, decompressFiles, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, compress, arginfo_phar_comps, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, decompress, arginfo_phar_decomp, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, convertToExecutable, arginfo_phar_conv, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, convertToData, arginfo_phar_conv, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, copy, arginfo_phar_copy, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, count, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, delete, arginfo_phar_delete, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, delMetadata, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, extractTo, arginfo_phar_extract, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, getAlias, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, getPath, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, getMetadata, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, getModified, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, getSignature, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, getStub, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, getVersion, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, hasMetadata, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, isBuffering, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, isCompressed, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, isFileFormat, arginfo_phar_isff, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, isWritable, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, offsetExists, arginfo_phar_offsetExists, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, offsetGet, arginfo_phar_offsetExists, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, offsetSet, arginfo_phar_offsetSet, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, offsetUnset, arginfo_phar_offsetExists, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, setAlias, arginfo_phar_setAlias, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, setDefaultStub, arginfo_phar_createDS, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, setMetadata, arginfo_phar_setMetadata, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, setSignatureAlgorithm, arginfo_phar_setSigAlgo, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, setStub, arginfo_phar_setStub, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, startBuffering, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(Phar, stopBuffering, arginfo_phar__void, ZEND_ACC_PUBLIC)
|
||||
#endif
|
||||
/* static member functions */
|
||||
PHP_ME(Phar, apiVersion, arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, canCompress, arginfo_phar_cancompress, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, canWrite, arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, createDefaultStub, arginfo_phar_createDS, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, getSupportedCompression,arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, getSupportedSignatures,arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, interceptFileFuncs, arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, isValidPharFilename, arginfo_phar_isvalidpharfilename, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, loadPhar, arginfo_phar_loadPhar, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, mapPhar, arginfo_phar_mapPhar, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, running, arginfo_phar_running, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, mount, arginfo_phar_mount, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, mungServer, arginfo_phar_mungServer, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, unlinkArchive, arginfo_phar_ua, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_ME(Phar, webPhar, arginfo_phar_webPhar, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
#if HAVE_SPL
|
||||
PHAR_ARG_INFO
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_entry___construct, 0, 0, 1)
|
||||
@@ -5521,7 +5449,7 @@ void phar_object_init(void) /* {{{ */
|
||||
|
||||
zend_class_implements(phar_ce_archive, 2, spl_ce_Countable, zend_ce_arrayaccess);
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "PharData", php_data_methods);
|
||||
INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods);
|
||||
phar_ce_data = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator);
|
||||
|
||||
zend_class_implements(phar_ce_data, 2, spl_ce_Countable, zend_ce_arrayaccess);
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Phar: bug #74386: Phar::__construct(): wrong number of parameters by reflection
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar") || !extension_loaded('reflection')) die("skip"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$r = new ReflectionMethod(Phar::class, '__construct');
|
||||
var_dump($r->getNumberOfRequiredParameters());
|
||||
var_dump($r->getNumberOfParameters());
|
||||
|
||||
$r = new ReflectionMethod(PharData::class, '__construct');
|
||||
var_dump($r->getNumberOfRequiredParameters());
|
||||
var_dump($r->getNumberOfParameters());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(3)
|
||||
int(1)
|
||||
int(4)
|
||||
===DONE===
|
||||
@@ -462,9 +462,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
|
||||
zval *value;
|
||||
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, value) {
|
||||
if (UNEXPECTED(zval_update_constant_ex(value, 1, NULL) == FAILURE)) {
|
||||
return;
|
||||
}
|
||||
zval_update_constant_ex(value, 1, NULL);
|
||||
_const_string(str, ZSTR_VAL(key), value, indent);
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
@@ -710,11 +708,7 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
|
||||
ZVAL_DUP(&zv, RT_CONSTANT(&fptr->op_array, precv->op2));
|
||||
old_scope = EG(scope);
|
||||
EG(scope) = fptr->common.scope;
|
||||
if (UNEXPECTED(zval_update_constant_ex(&zv, 1, NULL) == FAILURE)) {
|
||||
EG(scope) = old_scope;
|
||||
zval_ptr_dtor(&zv);
|
||||
return;
|
||||
}
|
||||
zval_update_constant_ex(&zv, 1, NULL);
|
||||
EG(scope) = old_scope;
|
||||
if (Z_TYPE(zv) == IS_TRUE) {
|
||||
string_write(str, "true", sizeof("true")-1);
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74673 (Segfault when cast Reflection object to string with undefined constant)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
throw new Exception();
|
||||
});
|
||||
|
||||
class A
|
||||
{
|
||||
public function method($test = PHP_SELF + 1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
$class = new ReflectionClass('A');
|
||||
|
||||
echo $class;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Method ReflectionClass::__toString() must not throw an exception, caught Exception: in %sbug74673.php on line %d
|
||||
+1
-1
@@ -2623,7 +2623,7 @@ static sdlAttributePtr make_persistent_sdl_attribute(sdlAttributePtr attr, HashT
|
||||
pattr->extraAttributes = malloc(sizeof(HashTable));
|
||||
zend_hash_init(pattr->extraAttributes, zend_hash_num_elements(attr->extraAttributes), NULL, delete_extra_attribute_persistent, 1);
|
||||
|
||||
ZEND_HASH_FOREACH_STR_KEY_PTR(attr->extraAttributes, key, tmp) {
|
||||
ZEND_HASH_FOREACH_STR_KEY_PTR(pattr->extraAttributes, key, tmp) {
|
||||
if (key) {
|
||||
pextra = malloc(sizeof(sdlExtraAttribute));
|
||||
memset(pextra, 0, sizeof(sdlExtraAttribute));
|
||||
|
||||
@@ -358,21 +358,6 @@ static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, in
|
||||
|
||||
intern = Z_SPLFIXEDARRAY_P(object);
|
||||
|
||||
if (type == BP_VAR_IS && intern->fptr_offset_has) {
|
||||
SEPARATE_ARG_IF_REF(offset);
|
||||
zend_call_method_with_1_params(object, intern->std.ce, &intern->fptr_offset_has, "offsetexists", rv, offset);
|
||||
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
|
||||
zval_ptr_dtor(offset);
|
||||
return NULL;
|
||||
}
|
||||
if (!i_zend_is_true(rv)) {
|
||||
zval_ptr_dtor(offset);
|
||||
zval_ptr_dtor(rv);
|
||||
return &EG(uninitialized_zval);
|
||||
}
|
||||
zval_ptr_dtor(rv);
|
||||
}
|
||||
|
||||
if (intern->fptr_offset_get) {
|
||||
zval tmp;
|
||||
if (!offset) {
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74478: null coalescing operator failing with SplFixedArray
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class MyFixedArray extends \SplFixedArray
|
||||
{
|
||||
public function offsetExists($name) {
|
||||
echo "offsetExists($name)\n";
|
||||
return parent::offsetExists($name);
|
||||
}
|
||||
public function offsetGet($name) {
|
||||
echo "offsetGet($name)\n";
|
||||
return parent::offsetGet($name);
|
||||
}
|
||||
public function offsetSet($name, $value) {
|
||||
echo "offsetSet($name)\n";
|
||||
return parent::offsetSet($name, $value);
|
||||
}
|
||||
public function offsetUnset($name) {
|
||||
echo "offsetUnset($name)\n";
|
||||
return parent::offsetUnset($name);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$fixedData = new MyFixedArray(10);
|
||||
var_dump(isset($fixedData[0][1][2]));
|
||||
var_dump(isset($fixedData[0]->foo));
|
||||
var_dump($fixedData[0] ?? 42);
|
||||
var_dump($fixedData[0][1][2] ?? 42);
|
||||
|
||||
$fixedData[0] = new MyFixedArray(10);
|
||||
$fixedData[0][1] = new MyFixedArray(10);
|
||||
var_dump(isset($fixedData[0][1][2]));
|
||||
var_dump($fixedData[0][1][2] ?? 42);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
offsetExists(0)
|
||||
bool(false)
|
||||
offsetExists(0)
|
||||
bool(false)
|
||||
offsetExists(0)
|
||||
int(42)
|
||||
offsetExists(0)
|
||||
int(42)
|
||||
offsetSet(0)
|
||||
offsetGet(0)
|
||||
offsetSet(1)
|
||||
offsetExists(0)
|
||||
offsetGet(0)
|
||||
offsetExists(1)
|
||||
offsetGet(1)
|
||||
offsetExists(2)
|
||||
bool(false)
|
||||
offsetExists(0)
|
||||
offsetGet(0)
|
||||
offsetExists(1)
|
||||
offsetGet(1)
|
||||
offsetExists(2)
|
||||
int(42)
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef PHP_SQLITE3_H
|
||||
#define PHP_SQLITE3_H
|
||||
|
||||
#define PHP_SQLITE3_VERSION PHP_VERSION
|
||||
#define PHP_SQLITE3_VERSION "0.7-dev"
|
||||
|
||||
extern zend_module_entry sqlite3_module_entry;
|
||||
#define phpext_sqlite3_ptr &sqlite3_module_entry
|
||||
|
||||
@@ -1912,11 +1912,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
/* }}} */
|
||||
/* {{{ random.c */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 1)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, length)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 2)
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, min)
|
||||
ZEND_ARG_INFO(0, max)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@@ -908,7 +908,7 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, i
|
||||
int result;
|
||||
char tmp_line[512];
|
||||
|
||||
stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL);
|
||||
stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
|
||||
if (!stream) {
|
||||
if (options & REPORT_ERRORS) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
|
||||
@@ -979,7 +979,7 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
|
||||
goto rename_errexit;
|
||||
}
|
||||
|
||||
stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, context, NULL, NULL, NULL, NULL);
|
||||
stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
if (!stream) {
|
||||
if (options & REPORT_ERRORS) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to connect to %s", resource_from->host);
|
||||
@@ -1037,7 +1037,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
|
||||
int result, recursive = options & PHP_STREAM_MKDIR_RECURSIVE;
|
||||
char tmp_line[512];
|
||||
|
||||
stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL);
|
||||
stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
|
||||
if (!stream) {
|
||||
if (options & REPORT_ERRORS) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
|
||||
@@ -1131,7 +1131,7 @@ static int php_stream_ftp_rmdir(php_stream_wrapper *wrapper, const char *url, in
|
||||
int result;
|
||||
char tmp_line[512];
|
||||
|
||||
stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, context, NULL, &resource, NULL, NULL);
|
||||
stream = php_ftp_fopen_connect(wrapper, url, "r", 0, NULL, NULL, NULL, &resource, NULL, NULL);
|
||||
if (!stream) {
|
||||
if (options & REPORT_ERRORS) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to connect to %s", url);
|
||||
|
||||
@@ -314,11 +314,6 @@ PHP_FUNCTION(stream_socket_get_name)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!ZSTR_LEN(name)) {
|
||||
zend_string_release(name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETVAL_STR(name);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -165,7 +165,7 @@ static zend_string *php_hex2bin(const unsigned char *old, const size_t oldlen)
|
||||
int is_letter = ((unsigned int) ((l - 'A') ^ (l - 'F' - 1))) >> (8 * sizeof(unsigned int) - 1);
|
||||
unsigned char d;
|
||||
|
||||
/* basically (c >= '0' && c <= '9') || (l >= 'A' && l <= 'F') */
|
||||
/* basically (c >= '0' && c <= '9') || (l >= 'A' && l <= 'F') */
|
||||
if (EXPECTED((((c ^ '0') - 10) >> (8 * sizeof(unsigned int) - 1)) | is_letter)) {
|
||||
d = (l - 0x10 - 0x27 * is_letter) << 4;
|
||||
} else {
|
||||
@@ -2371,7 +2371,7 @@ PHP_FUNCTION(substr)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((size_t)l > ZSTR_LEN(str) - (size_t)f) {
|
||||
if ((f + l) > (zend_long)ZSTR_LEN(str)) {
|
||||
l = ZSTR_LEN(str) - f;
|
||||
}
|
||||
|
||||
@@ -2842,7 +2842,7 @@ PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size
|
||||
for (i = 0; i < trlen; i++) {
|
||||
xlat[(size_t)(unsigned char) str_from[i]] = str_to[i];
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
str[i] = xlat[(size_t)(unsigned char) str[i]];
|
||||
}
|
||||
@@ -3235,7 +3235,7 @@ static zend_string *php_str_to_str_i_ex(zend_string *haystack, char *lc_haystack
|
||||
zend_string_release(lc_needle);
|
||||
goto nothing_todo;
|
||||
}
|
||||
|
||||
|
||||
if (str_len > ZSTR_LEN(lc_needle)) {
|
||||
new_str = zend_string_safe_alloc(count, str_len - ZSTR_LEN(lc_needle), ZSTR_LEN(haystack), 0);
|
||||
} else {
|
||||
@@ -3398,7 +3398,7 @@ PHP_FUNCTION(strtr)
|
||||
ZVAL_LONG(&tmp, num_key);
|
||||
convert_to_string(&tmp);
|
||||
str_key = Z_STR(tmp);
|
||||
}
|
||||
}
|
||||
replace = zval_get_string(entry);
|
||||
if (ZSTR_LEN(str_key) < 1) {
|
||||
RETVAL_STR_COPY(str);
|
||||
@@ -3961,7 +3961,7 @@ static zend_long php_str_replace_in_subject(zval *search, zval *replace, zval *s
|
||||
zend_string_release(lc_subject_str);
|
||||
lc_subject_str = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
zend_string_release(search_str);
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74708 Wrong reflection on random_bytes and random_int
|
||||
--FILE--
|
||||
<?php
|
||||
$rf = new ReflectionFunction('random_bytes');
|
||||
var_dump($rf->getNumberOfParameters());
|
||||
var_dump($rf->getNumberOfRequiredParameters());
|
||||
|
||||
$rf = new ReflectionFunction('random_int');
|
||||
var_dump($rf->getNumberOfParameters());
|
||||
var_dump($rf->getNumberOfRequiredParameters());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
int(2)
|
||||
int(2)
|
||||
===DONE===
|
||||
@@ -42,7 +42,7 @@ bool(false)
|
||||
Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 32 of 32 bytes in %sbug25378.php on line %d
|
||||
Notice: unserialize(): Error at offset 33 of 32 bytes in %sbug25378.php on line %d
|
||||
bool(false)
|
||||
|
||||
Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74101: Unserialize Heap Use-After-Free (READ: 1) in zval_get_type
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'O:9:"Exception":799999999999999999999999999997:0i:0;a:0:{}i:2;i:0;i:0;R:2;';
|
||||
var_dump(unserialize($s));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 48 of 74 bytes in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74111: Heap buffer overread (READ: 1) finish_nested_data from unserialize
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'O:8:"stdClass":00000000';
|
||||
var_dump(unserialize($s));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 25 of 23 bytes in %s on line %d
|
||||
bool(false)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74614: Use-after-free in PHP7's unserialize()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
unserialize('a:3020000000000000000000000000000001:{i:0;a:0:{}i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:5;i:6;i:6;i:7;i:7;i:8;i:8;R:2;}');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset %d of 113 bytes in %s on line %d
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74556 stream_socket_get_name() on unix socket returns "\0"
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!strncasecmp(PHP_OS, 'WIN', 3)) echo "skip Unix Only";
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$sock = __DIR__ . '/bug74556.sock';
|
||||
$s = stream_socket_server("unix://$sock");
|
||||
$c = stream_socket_client("unix://$sock");
|
||||
|
||||
var_dump(
|
||||
stream_socket_get_name($s, true),
|
||||
stream_socket_get_name($c, false)
|
||||
);
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . '/bug74556.sock');
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
@@ -48,7 +48,7 @@ DONE
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 0 of 3 bytes in %sbug70436.php on line %d
|
||||
|
||||
Notice: unserialize(): Error at offset 16 of 17 bytes in %sbug70436.php on line %d
|
||||
Notice: unserialize(): Error at offset 17 of 17 bytes in %sbug70436.php on line %d
|
||||
|
||||
Notice: unserialize(): Error at offset 93 of 94 bytes in %sbug70436.php on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -14,5 +14,5 @@ unserialize($poc);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Notice: unserialize(): Error at offset 50 of 50 bytes in %sbug72663_3.php on line %d
|
||||
Notice: unserialize(): Error at offset 51 of 50 bytes in %sbug72663_3.php on line %d
|
||||
DONE
|
||||
+542
-521
File diff suppressed because it is too large.
Load diff
@@ -432,12 +432,13 @@ string_key:
|
||||
|
||||
static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
|
||||
{
|
||||
if (*p >= max || **p != '}') {
|
||||
return 0;
|
||||
}
|
||||
if (*((*p)++) == '}')
|
||||
return 1;
|
||||
|
||||
(*p)++;
|
||||
return 1;
|
||||
#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE
|
||||
zval_ptr_dtor(rval);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
|
||||
@@ -506,10 +507,6 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
|
||||
&& zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1);
|
||||
|
||||
ht = Z_OBJPROP_P(rval);
|
||||
if (elements >= HT_MAX_SIZE - zend_hash_num_elements(ht)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
zend_hash_extend(ht, zend_hash_num_elements(ht) + elements, (ht->u.flags & HASH_FLAG_PACKED));
|
||||
if (!process_nested_data(UNSERIALIZE_PASSTHRU, ht, elements, 1)) {
|
||||
if (has_wakeup) {
|
||||
@@ -772,7 +769,7 @@ use_double:
|
||||
*p = YYCURSOR;
|
||||
if (!var_hash) return 0;
|
||||
|
||||
if (elements < 0 || elements >= HT_MAX_SIZE) {
|
||||
if (elements < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -791,11 +788,11 @@ use_double:
|
||||
}
|
||||
|
||||
"o:" iv ":" ["] {
|
||||
zend_long elements;
|
||||
long elements;
|
||||
if (!var_hash) return 0;
|
||||
|
||||
elements = object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR);
|
||||
if (elements < 0 || elements >= HT_MAX_SIZE) {
|
||||
if (elements < 0) {
|
||||
return 0;
|
||||
}
|
||||
return object_common2(UNSERIALIZE_PASSTHRU, elements);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #74145 (wddx parsing empty boolean tag leads to SIGSEGV)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("wddx")) print "skip";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$data = file_get_contents(__DIR__ . '/bug74145.xml');
|
||||
$wddx = wddx_deserialize($data);
|
||||
var_dump($wddx);
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
NULL
|
||||
DONE
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version='1.0' ?>
|
||||
<!DOCTYPE et SYSTEM 'w'>
|
||||
<wddxPacket ven='1.0'>
|
||||
<array>
|
||||
<var Name="name">
|
||||
<boolean ></boolean>
|
||||
</var>
|
||||
</array>
|
||||
</wddxPacket>
|
||||
+9
-2
@@ -471,6 +471,10 @@ static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
|
||||
*/
|
||||
if (call_user_function_ex(CG(function_table), obj, &fname, &retval, 0, 0, 1, NULL) == SUCCESS) {
|
||||
if (!Z_ISUNDEF(retval) && (sleephash = HASH_OF(&retval))) {
|
||||
PHP_CLASS_ATTRIBUTES;
|
||||
|
||||
PHP_SET_CLASS_ATTRIBUTES(obj);
|
||||
|
||||
php_wddx_add_chunk_static(packet, WDDX_STRUCT_S);
|
||||
snprintf(tmp_buf, WDDX_BUF_LEN, WDDX_VAR_S, PHP_CLASS_NAME_VAR);
|
||||
php_wddx_add_chunk(packet, tmp_buf);
|
||||
@@ -758,16 +762,19 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
|
||||
} else if (!strcmp((char *)name, EL_BOOLEAN)) {
|
||||
int i;
|
||||
|
||||
ent.type = ST_BOOLEAN;
|
||||
SET_STACK_VARNAME;
|
||||
if (atts) for (i = 0; atts[i]; i++) {
|
||||
if (!strcmp((char *)atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) {
|
||||
ent.type = ST_BOOLEAN;
|
||||
SET_STACK_VARNAME;
|
||||
|
||||
ZVAL_TRUE(&ent.data);
|
||||
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
|
||||
php_wddx_process_data(user_data, atts[i+1], strlen((char *)atts[i+1]));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ent.type = ST_BOOLEAN;
|
||||
SET_STACK_VARNAME;
|
||||
ZVAL_FALSE(&ent.data);
|
||||
wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));
|
||||
}
|
||||
|
||||
+1
-1
@@ -656,7 +656,7 @@ PHPAPI void php_network_populate_name_from_sockaddr(
|
||||
|
||||
if (ua->sun_path[0] == '\0') {
|
||||
/* abstract name */
|
||||
int len = sl - sizeof(sa_family_t);
|
||||
int len = strlen(ua->sun_path + 1) + 1;
|
||||
*textaddr = zend_string_init((char*)ua->sun_path, len, 0);
|
||||
} else {
|
||||
int len = strlen(ua->sun_path);
|
||||
|
||||
+3
-5
@@ -280,7 +280,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t
|
||||
size_t key_len;
|
||||
|
||||
/* PATH sections */
|
||||
if (!zend_binary_strncasecmp(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), "PATH", sizeof("PATH") - 1, sizeof("PATH") - 1)) {
|
||||
if (zend_string_equals_literal_ci(Z_STR_P(arg1), "PATH")) {
|
||||
key = Z_STRVAL_P(arg1);
|
||||
key = key + sizeof("PATH") - 1;
|
||||
key_len = Z_STRLEN_P(arg1) - sizeof("PATH") + 1;
|
||||
@@ -291,7 +291,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t
|
||||
TRANSLATE_SLASHES_LOWER(key);
|
||||
|
||||
/* HOST sections */
|
||||
} else if (!zend_binary_strncasecmp(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), "HOST", sizeof("HOST") - 1, sizeof("HOST") - 1)) {
|
||||
} else if (zend_string_equals_literal_ci(Z_STR_P(arg1), "HOST")) {
|
||||
key = Z_STRVAL_P(arg1);
|
||||
key = key + sizeof("HOST") - 1;
|
||||
key_len = Z_STRLEN_P(arg1) - sizeof("HOST") + 1;
|
||||
@@ -328,9 +328,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t
|
||||
zend_hash_init(Z_ARRVAL(section_arr), 8, NULL, (dtor_func_t) config_zval_dtor, 1);
|
||||
entry = zend_hash_str_update(target_hash, key, key_len, §ion_arr);
|
||||
}
|
||||
if (Z_TYPE_P(entry) == IS_ARRAY) {
|
||||
active_ini_hash = Z_ARRVAL_P(entry);
|
||||
}
|
||||
active_ini_hash = Z_ARRVAL_P(entry);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
+3
-3
@@ -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 21
|
||||
#define PHP_RELEASE_VERSION 20
|
||||
#define PHP_EXTRA_VERSION ""
|
||||
#define PHP_VERSION "7.0.21"
|
||||
#define PHP_VERSION_ID 70021
|
||||
#define PHP_VERSION "7.0.20"
|
||||
#define PHP_VERSION_ID 70020
|
||||
@@ -1,46 +0,0 @@
|
||||
--TEST--
|
||||
HOST/PATH ini sections test for cli
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!getenv("TEST_PHP_EXECUTABLE")) die("skip TEST_PHP_EXECUTABLE not set");
|
||||
if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows test");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$php = getenv("TEST_PHP_EXECUTABLE");
|
||||
$cwd = getcwd();
|
||||
$ini_file = __DIR__ . "/023.ini";
|
||||
file_put_contents($ini_file, <<<INI
|
||||
; no sections should match as cli doesn't support any
|
||||
memory_limit = 40M
|
||||
[PATH={$cwd}]
|
||||
memory_limit = 50M
|
||||
[PATH=/does/not/exist]
|
||||
memory_limit = 60M
|
||||
[HOST=some_fake_host]
|
||||
memory_limit = 70M
|
||||
INI
|
||||
);
|
||||
$desc = array(
|
||||
0 => array("pipe", "r"),
|
||||
1 => array("pipe", "w"),
|
||||
2 => array("pipe", "w"),
|
||||
);
|
||||
$pipes = array();
|
||||
$proc = proc_open("$php -c $ini_file -r 'echo ini_get(\"memory_limit\");'", $desc, $pipes);
|
||||
if (!$proc) {
|
||||
exit(1);
|
||||
}
|
||||
var_dump(stream_get_contents($pipes[1]));
|
||||
var_dump(stream_get_contents($pipes[2]));
|
||||
|
||||
proc_terminate($proc);
|
||||
proc_close($proc);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . "/023.ini");
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "40M"
|
||||
string(0) ""
|
||||
Reference in new issue
Block a user