mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-16 13:36:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21ae2ba39d | ||
|
|
0c8bda1fe9 | ||
|
|
657609ebae | ||
|
|
0da10134f2 | ||
|
|
735468a0b8 | ||
|
|
649027b963 | ||
|
|
65d5e025a7 | ||
|
|
4ef9f536ba | ||
|
|
e0282c3b58 | ||
|
|
4d08b9dac0 | ||
|
|
2e82ed9b73 | ||
|
|
0db20a7cb1 | ||
|
|
6cd140fdf8 | ||
|
|
0b5683e480 | ||
|
|
5d15fdc4a4 | ||
|
|
3b60af90fd | ||
|
|
c1504b81d3 | ||
|
|
91aad4bc81 | ||
|
|
2f606dc5e8 | ||
|
|
8b04e89ef0 | ||
|
|
04cc2f6473 | ||
|
|
82acb58d8a | ||
|
|
3da01a9652 | ||
|
|
3bcab31749 | ||
|
|
be531ce9f0 | ||
|
|
b47cff48de | ||
|
|
7360e6a36f | ||
|
|
a797421e98 | ||
|
|
fd08eaa8bc | ||
|
|
de32c9efc8 | ||
|
|
2689917b17 | ||
|
|
ccd0ff3ac4 | ||
|
|
5cf54f6073 | ||
|
|
7938b9ccac | ||
|
|
e89476a870 | ||
|
|
62700f76cb | ||
|
|
02cc492015 | ||
|
|
b5338c0b7d | ||
|
|
b38de96733 | ||
|
|
0fdceb6cd5 | ||
|
|
0d3e6f6add | ||
|
|
5c96a255ea | ||
|
|
5ca02ca494 | ||
|
|
18eb78854c | ||
|
|
700803b70c | ||
|
|
739ecf5430 | ||
|
|
1af5ca0746 | ||
|
|
2928feca46 | ||
|
|
fb140d582c | ||
|
|
af07b76ccf | ||
|
|
390f64701d | ||
|
|
7991a88675 | ||
|
|
489f3a3234 | ||
|
|
aa3fceeaad | ||
|
|
1e3b960ab5 | ||
|
|
8b1559b9f4 | ||
|
|
55b880070c | ||
|
|
703be4f77e | ||
|
|
27a743b82b | ||
|
|
bdf7393ddb | ||
|
|
2693e52113 | ||
|
|
4e68b2c52b | ||
|
|
0ba04f7737 | ||
|
|
54840f9c8f | ||
|
|
f269cdcd4f | ||
|
|
f76a6cd023 | ||
|
|
6b18d956de | ||
|
|
e46d589624 | ||
|
|
0496f5407f | ||
|
|
3a25a56a92 | ||
|
|
0525574913 | ||
|
|
73cabfedf5 | ||
|
|
12107d619b | ||
|
|
f7f4fd4706 | ||
|
|
e8b7698f5e | ||
|
|
2aae60461c | ||
|
|
f8c514ba6b | ||
|
|
8dc4f4dc9e | ||
|
|
5f8380d33e | ||
|
|
89637c6b41 | ||
|
|
1fa8e74d6e | ||
|
|
4b38feabe7 | ||
|
|
41ba98f02d | ||
|
|
a29264eb8c | ||
|
|
396c0f7a76 | ||
|
|
4903f044d3 | ||
|
|
6f78923d1f | ||
|
|
04904333fd | ||
|
|
ce64b82ebb | ||
|
|
2dc24005d9 | ||
|
|
d02f953faf | ||
|
|
9d1575c495 | ||
|
|
d0b7eed0c9 | ||
|
|
667185a264 | ||
|
|
c71b773a62 | ||
|
|
af7bfc71fd | ||
|
|
e3cc15daf2 | ||
|
|
72f7143295 | ||
|
|
e57fce4d00 | ||
|
|
2a1ad88538 | ||
|
|
3f4340a796 | ||
|
|
c8bb64c406 | ||
|
|
f15790ec73 | ||
|
|
08089f014c | ||
|
|
a99c5f28c5 | ||
|
|
4e4f2f9f89 | ||
|
|
751d19f698 | ||
|
|
e938cfc921 | ||
|
|
604827b694 | ||
|
|
44d734254a | ||
|
|
cfee5116dd | ||
|
|
0c4f11ecaa | ||
|
|
653b96347c | ||
|
|
2fddc4a7f1 | ||
|
|
0c707fcb10 | ||
|
|
bda0f4e8dc | ||
|
|
de66e80d75 | ||
|
|
fda0a8b735 | ||
|
|
cd1869bcf2 | ||
|
|
3eecee16d1 | ||
|
|
4e98990f6b | ||
|
|
b714309056 | ||
|
|
5b5a92b8b6 | ||
|
|
4948da178a | ||
|
|
721de5b542 | ||
|
|
4d6100569b | ||
|
|
bd8940a1fe | ||
|
|
b255b97e43 | ||
|
|
b903733762 | ||
|
|
b1301a0686 | ||
|
|
21cbdf6984 | ||
|
|
660250f4da | ||
|
|
c56378b0d5 | ||
|
|
81c2a4b9ba | ||
|
|
ed1f64e083 | ||
|
|
db287b2303 | ||
|
|
c288ed44a2 | ||
|
|
5d666d2a02 | ||
|
|
b3bd379198 | ||
|
|
cda87977a5 | ||
|
|
b4c5f20c46 | ||
|
|
fa3615f14e | ||
|
|
13347e8a7d | ||
|
|
3fbbcf7f93 | ||
|
|
d9feb3c2d0 | ||
|
|
1bdc290017 | ||
|
|
18b6de7a91 | ||
|
|
14c422a32f | ||
|
|
78bec63ad9 | ||
|
|
67f063e3ac | ||
|
|
6a854e2740 | ||
|
|
3f2cfac5d6 | ||
|
|
b4fa2ba295 | ||
|
|
0f8cf3b849 | ||
|
|
3303e87101 | ||
|
|
7ecddd2c24 | ||
|
|
27d6814351 | ||
|
|
f39c9d8345 | ||
|
|
64447030bb | ||
|
|
b1431c6174 | ||
|
|
073ac50374 | ||
|
|
98bcc0bd43 | ||
|
|
82bb98ce1a | ||
|
|
135265ef69 | ||
|
|
b742a18ba4 | ||
|
|
ec6ac50812 | ||
|
|
1b797f7ad3 | ||
|
|
058bec9e33 | ||
|
|
a6c67a088a | ||
|
|
51a7e35c24 | ||
|
|
fbb884e532 | ||
|
|
509f5097ab | ||
|
|
bfa9362d43 | ||
|
|
887fabe78f | ||
|
|
7275084388 | ||
|
|
4a39d33ee5 | ||
|
|
c2a348b5bc | ||
|
|
f19dfac830 | ||
|
|
84b9b164a8 | ||
|
|
648be8600f | ||
|
|
6408c66d3c | ||
|
|
90f33b1ac7 | ||
|
|
c4d7cfa536 | ||
|
|
78970d5338 | ||
|
|
5f07a895cc | ||
|
|
593d37376b | ||
|
|
3aa80c482c | ||
|
|
aea8c6ddc1 | ||
|
|
81b2533a68 | ||
|
|
b7c2c44a8d | ||
|
|
c0678be3e0 | ||
|
|
3968ffe7b3 | ||
|
|
caf35c5cf5 | ||
|
|
e05f79c3de | ||
|
|
0fa40b0546 | ||
|
|
91f129ebf7 | ||
|
|
6d46528d54 | ||
|
|
cbe73b3cfe | ||
|
|
1980234fc2 | ||
|
|
c3b910370c | ||
|
|
ee0e6963f3 | ||
|
|
844f4292ef | ||
|
|
9997767dc3 | ||
|
|
c39a10bc6e | ||
|
|
ff93f74f63 | ||
|
|
3704947696 | ||
|
|
6af1d7ad01 | ||
|
|
585c9f3c4b | ||
|
|
6b511d124e | ||
|
|
d9fd44366d | ||
|
|
d027bc2add | ||
|
|
bfedff58e3 | ||
|
|
95c4564f93 | ||
|
|
c742abb3ce | ||
|
|
cea34425f3 | ||
|
|
e9ff1fac85 | ||
|
|
48598a2302 | ||
|
|
741769d933 | ||
|
|
9064dca58b | ||
|
|
9c5717d0de | ||
|
|
316aaca155 | ||
|
|
77cbf8a657 | ||
|
|
1bb295e659 | ||
|
|
dc7e53690f | ||
|
|
b11393fccb | ||
|
|
bee52f352f | ||
|
|
46bb35a853 | ||
|
|
1c845d2950 | ||
|
|
5416deec66 | ||
|
|
6a8ae7cf8d | ||
|
|
60b1829e1c | ||
|
|
1e0c4386ab | ||
|
|
d6922ef8e3 | ||
|
|
d351c199bb | ||
|
|
2dee44c74c | ||
|
|
e628ee9e9d | ||
|
|
8dcfec9789 | ||
|
|
6d2d0bbda7 | ||
|
|
d9458aac9d | ||
|
|
05849a242a | ||
|
|
398efb087c | ||
|
|
19befb1ca2 | ||
|
|
60912e66c8 | ||
|
|
1838f965bc | ||
|
|
ece7d223e8 | ||
|
|
63ca6f93a1 | ||
|
|
cd3520c4d3 | ||
|
|
5269c4cacb | ||
|
|
49d1cdc393 | ||
|
|
fc87715950 | ||
|
|
d51b8f915f | ||
|
|
e7a7065024 | ||
|
|
872e43d6e5 | ||
|
|
e535b80257 | ||
|
|
056cb8c256 | ||
|
|
fff1cab367 | ||
|
|
65bf0364b6 | ||
|
|
c4ae856912 | ||
|
|
11b4f105bf | ||
|
|
08293a960b | ||
|
|
459c382df5 | ||
|
|
26f217bf40 | ||
|
|
464c1639ae | ||
|
|
649494c0ee | ||
|
|
78b10dd9d6 | ||
|
|
0954ea8d6d | ||
|
|
f38487a0e0 | ||
|
|
ef09bc0645 | ||
|
|
d3e3bc611a | ||
|
|
e347b2ded6 | ||
|
|
02e9e59beb | ||
|
|
6e3d24bcf4 | ||
|
|
b73a73da25 | ||
|
|
71f8c4dcfd | ||
|
|
c667bb94fa | ||
|
|
8a1713e39c | ||
|
|
9f49ebb5ba | ||
|
|
7d418430fd | ||
|
|
d74fbfb38f | ||
|
|
7f051ac583 | ||
|
|
e04b91e6e2 | ||
|
|
89dd7fb328 | ||
|
|
8ec91086ee | ||
|
|
b067bda4cd | ||
|
|
777929b1ae | ||
|
|
42e5df141c | ||
|
|
ae3f975c5d | ||
|
|
2e5a747b59 | ||
|
|
c1d5718697 | ||
|
|
8cbfc882d2 | ||
|
|
cfe577fb86 | ||
|
|
90bd4be3f9 | ||
|
|
b8e0351978 | ||
|
|
05c90e5994 | ||
|
|
1b22e9dc2e | ||
|
|
d40a852919 | ||
|
|
15dbe775d1 | ||
|
|
99549ce79c | ||
|
|
b39c70b4a7 | ||
|
|
72073228ca | ||
|
|
1a06fae543 | ||
|
|
83033f0b32 | ||
|
|
bdd66e1492 | ||
|
|
ca870dfee7 | ||
|
|
abad134681 | ||
|
|
2d30bc96a1 | ||
|
|
b966a8b5fa | ||
|
|
62c1edf535 | ||
|
|
2c070847e7 | ||
|
|
87d56a3d07 | ||
|
|
5dafb523fd | ||
|
|
6658b437ae | ||
|
|
5c957b502e | ||
|
|
378f785515 | ||
|
|
561f1afe6e | ||
|
|
4b3a11b329 | ||
|
|
476b7f1667 | ||
|
|
622dc2a611 | ||
|
|
64adba3b3f | ||
|
|
c0c0871911 | ||
|
|
7431d6dda6 | ||
|
|
f97607027a | ||
|
|
36c53036e7 | ||
|
|
3d9563b8b2 | ||
|
|
20a608d9da | ||
|
|
6bd30e8f1a | ||
|
|
4c0e50c88a | ||
|
|
2735318c7b | ||
|
|
f50df1d0e3 | ||
|
|
023cbdb2ca | ||
|
|
a581e64199 | ||
|
|
e3f411c9f7 | ||
|
|
1967950dc3 | ||
|
|
9622a3be43 | ||
|
|
d9dfac90bf | ||
|
|
6028fe511e | ||
|
|
9891b9ede2 | ||
|
|
c436fe2426 | ||
|
|
a0b9554f94 | ||
|
|
d83d5f4198 | ||
|
|
7b392c7154 | ||
|
|
e7166ea9be | ||
|
|
9a07e9e1f8 | ||
|
|
38a65d5ef9 | ||
|
|
e67096dbbb | ||
|
|
392bcba58d | ||
|
|
09ef61e3ca | ||
|
|
bf3e2dce7b | ||
|
|
66dbeb81ba | ||
|
|
36301bd615 | ||
|
|
a1e74a9e0e | ||
|
|
c0203c0ceb | ||
|
|
3f6d9fe9cc | ||
|
|
f639b64dca | ||
|
|
7962185ded | ||
|
|
8cfaea656c | ||
|
|
91a0d48675 |
No files matched your search
+2
-2
@@ -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.1
|
||||
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.7
|
||||
# ext and env setup for tests
|
||||
#MYSQL_TEST_PASSWD: Password12!
|
||||
#MYSQL_TEST_USER: root
|
||||
@@ -43,7 +43,7 @@ environment:
|
||||
services:
|
||||
# the setup scripts have to be touched, once some other db version is used
|
||||
- mysql
|
||||
- postgresql95
|
||||
- postgresql96
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
+1
-1
@@ -57,4 +57,4 @@ before_script:
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 1 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
|
||||
@@ -1,6 +1,165 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2017, PHP 7.1.5
|
||||
03 Aug 2017, PHP 7.1.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74832 (Loading PHP extension with already registered function
|
||||
name leads to a crash). (jpauli)
|
||||
. Fixed bug #74780 (parse_url() broken when query string contains colon).
|
||||
(jhdxr)
|
||||
. Fixed bug #74761 (Unary operator expected error on some systems). (petk)
|
||||
. Fixed bug #73900 (Use After Free in unserialize() SplFixedArray). (nikic)
|
||||
. Fixed bug #74923 (Crash when crawling through network share). (Anatol)
|
||||
. Fixed bug #74913 (fixed incorrect poll.h include). (petk)
|
||||
. Fixed bug #74906 (fixed incorrect errno.h include). (petk)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74852 (property_exists returns true on unknown DateInterval
|
||||
property). (jhdxr)
|
||||
|
||||
- OCI8:
|
||||
. Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74623 (Infinite loop in type inference when using HTMLPurifier).
|
||||
(nikic)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74798 (pkcs7_en/decrypt does not work if \x0a is used in content).
|
||||
(Anatol)
|
||||
. Added OPENSSL_DONT_ZERO_PAD_KEY constant to prevent key padding and fix bug
|
||||
#71917 (openssl_open() returns junk on envelope < 16 bytes) and bug #72362
|
||||
(OpenSSL Blowfish encryption is incorrect for short keys). (Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #69356 (PDOStatement::debugDumpParams() truncates query). (Adam
|
||||
Baratz)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #73471 (PHP freezes with AppendIterator). (jhdxr)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #74883 (SQLite3::__construct() produces "out of memory" exception
|
||||
with invalid flags). (Anatol)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #73173 (huge memleak when wddx_unserialize).
|
||||
(tloi at fortinet dot com)
|
||||
|
||||
- zlib:
|
||||
. Fixed bug #73944 (dictionary option of inflate_init() does not work).
|
||||
(wapmorgan)
|
||||
|
||||
06 Jul 2017, PHP 7.1.7
|
||||
|
||||
- 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 #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
|
||||
(Stas)
|
||||
. 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 #74819 (wddx_deserialize() heap out-of-bound read via
|
||||
php_parse_date()). (Derick)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74639 (implement clone for DatePeriod and DateInterval).
|
||||
(andrewnester)
|
||||
|
||||
- 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)
|
||||
|
||||
- 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)
|
||||
. Revert opcache.enable_cli to default disabled. (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #74720 (pkcs7_en/decrypt does not work if \x1a is used in
|
||||
content). (Anatol)
|
||||
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
|
||||
(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)
|
||||
|
||||
- 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.1.6
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i).
|
||||
(Laruence)
|
||||
. Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST).
|
||||
(Laruence)
|
||||
. Fixed bug #74589 (__DIR__ wrong for unicode character). (Anatol)
|
||||
|
||||
- intl:
|
||||
. Fixed bug #74468 (wrong reflection on Collator::sortWithSortKeys). (villfa)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74547 (mysqli::change_user() doesn't accept null as $database
|
||||
argument w/strict_types). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #74596 (SIGSEGV with opcache.revalidate_path enabled). (Laruence)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #51918 (Phar::webPhar() does not handle requests sent through PUT
|
||||
and DELETE method). (Christian Weiske)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #74490 (readline() moves the cursor to the beginning of the line).
|
||||
(Anatol)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74510 (win32/sendmail.c anchors CC header but not BCC).
|
||||
(Damian Wadley, Anatol)
|
||||
|
||||
- xmlreader:
|
||||
. Fixed bug #74457 (Wrong reflection on XMLReader::expand). (villfa)
|
||||
|
||||
11 May 2017, PHP 7.1.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74408 (Endless loop bypassing execution time limit). (Laruence)
|
||||
@@ -15,6 +174,7 @@ PHP NEWS
|
||||
(Matt Ficken)
|
||||
. Fixed bug #74337 (php-cgi.exe crash on facebook callback).
|
||||
(Anton Serbulov)
|
||||
. Patch for bug #74216 was reverted. (Anatol)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74404 (Wrong reflection on DateTimeZone::getTransitions).
|
||||
@@ -33,6 +193,10 @@ PHP NEWS
|
||||
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
|
||||
(krakjoe)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74432 (mysqli_connect adding ":3306" to $host if $port parameter
|
||||
not given). (Anatol)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #74376 (Invalid free of persistent results on error/connection
|
||||
loss). (Yussuf Khalil)
|
||||
@@ -57,6 +221,8 @@ PHP NEWS
|
||||
key). (Jakub Zelenka)
|
||||
. Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
|
||||
seconds). (Moritz Fain)
|
||||
. Fixed bug #73808 (iv length warning too restrictive for aes-128-ccm).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- phar:
|
||||
. Fixed bug #74383 (phar method parameters reflection correction).
|
||||
@@ -198,6 +364,8 @@ PHP NEWS
|
||||
anonymous classes). (Adam Saponara)
|
||||
. Fixed bug #74105 (PHP on Linux should use /dev/urandom when getrandom is
|
||||
not available). (Benjamin Robin)
|
||||
. Fixed bug #74708 (Invalid Reflection signatures for random_bytes and
|
||||
random_int). (Tyson Andre, Remi)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #73496 (Invalid memory access in zend_inline_hash_func).
|
||||
|
||||
@@ -53,27 +53,43 @@ string(3) "1st"
|
||||
string(3) "2nd"
|
||||
NULL
|
||||
string(3) "4th"
|
||||
array(3) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(3) "1st"
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(2) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(2) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
&string(3) "2nd"
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
array(1) {
|
||||
array(4) {
|
||||
[0]=>
|
||||
NULL
|
||||
[1]=>
|
||||
NULL
|
||||
[2]=>
|
||||
NULL
|
||||
[3]=>
|
||||
string(3) "4th"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #73900: Use After Free in unserialize() SplFixedArray
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = new stdClass;
|
||||
$b = new SplFixedArray(1);
|
||||
$b[0] = $a;
|
||||
$c = &$b[0];
|
||||
var_dump($c);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
|
||||
--FILE--
|
||||
<?php
|
||||
"000000"[0]::d;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class '0' not found in %sbug74546.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sbug74546.php on line %d
|
||||
@@ -0,0 +1 @@
|
||||
0=0&~2000000000
|
||||
@@ -0,0 +1,15 @@
|
||||
--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"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
--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
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #74840: Opcache overwrites argument of GENERATOR_RETURN within finally
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$g = (function($a) {
|
||||
try {
|
||||
return $a + 1;
|
||||
} finally {
|
||||
$b = $a + 2;
|
||||
var_dump($b);
|
||||
}
|
||||
yield; // Generator
|
||||
})(1);
|
||||
$g->next();
|
||||
var_dump($g->getReturn());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(3)
|
||||
int(2)
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #74606 (Segfault within try/catch/finally nesting in Generators)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
$array = ["foo"];
|
||||
$array[] = "bar";
|
||||
|
||||
foreach ($array as $item) {
|
||||
try {
|
||||
try {
|
||||
yield;
|
||||
} finally {
|
||||
echo "fin $item\n";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo "catch\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
gen()->throw(new Exception);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
fin foo
|
||||
catch
|
||||
fin bar
|
||||
+5
-3
@@ -1088,8 +1088,6 @@ 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;
|
||||
@@ -1158,7 +1156,9 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
|
||||
ce = ce->parent;
|
||||
}
|
||||
}
|
||||
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2024,17 +2024,19 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
|
||||
zend_string_release(lcname);
|
||||
return NULL;
|
||||
}
|
||||
zend_string_release(lcname);
|
||||
module = module_ptr;
|
||||
EG(current_module) = module;
|
||||
|
||||
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAILURE) {
|
||||
zend_hash_del(&module_registry, lcname);
|
||||
zend_string_release(lcname);
|
||||
EG(current_module) = NULL;
|
||||
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EG(current_module) = NULL;
|
||||
zend_string_release(lcname);
|
||||
return module;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -574,7 +574,7 @@ ZEND_FUNCTION(func_get_args)
|
||||
{
|
||||
zval *p, *q;
|
||||
uint32_t arg_count, first_extra_arg;
|
||||
uint32_t i, n;
|
||||
uint32_t i;
|
||||
zend_execute_data *ex = EX(prev_execute_data);
|
||||
|
||||
if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
|
||||
@@ -594,7 +594,6 @@ ZEND_FUNCTION(func_get_args)
|
||||
zend_hash_real_init(Z_ARRVAL_P(return_value), 1);
|
||||
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
|
||||
i = 0;
|
||||
n = 0;
|
||||
p = ZEND_CALL_ARG(ex, 1);
|
||||
if (arg_count > first_extra_arg) {
|
||||
while (i < first_extra_arg) {
|
||||
@@ -604,7 +603,8 @@ ZEND_FUNCTION(func_get_args)
|
||||
if (Z_OPT_REFCOUNTED_P(q)) {
|
||||
Z_ADDREF_P(q);
|
||||
}
|
||||
n++;
|
||||
} else {
|
||||
q = &EG(uninitialized_zval);
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(q);
|
||||
p++;
|
||||
@@ -619,14 +619,15 @@ ZEND_FUNCTION(func_get_args)
|
||||
if (Z_OPT_REFCOUNTED_P(q)) {
|
||||
Z_ADDREF_P(q);
|
||||
}
|
||||
n++;
|
||||
} else {
|
||||
q = &EG(uninitialized_zval);
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(q);
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
} ZEND_HASH_FILL_END();
|
||||
Z_ARRVAL_P(return_value)->nNumOfElements = n;
|
||||
Z_ARRVAL_P(return_value)->nNumOfElements = arg_count;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2301,7 +2302,6 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
array_init_size(arg_array, num_args);
|
||||
if (num_args) {
|
||||
uint32_t i = 0;
|
||||
uint32_t n = 0;
|
||||
zval *p = ZEND_CALL_ARG(call, 1);
|
||||
|
||||
zend_hash_real_init(Z_ARRVAL_P(arg_array), 1);
|
||||
@@ -2324,12 +2324,9 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
if (Z_OPT_REFCOUNTED_P(arg)) {
|
||||
Z_ADDREF_P(arg);
|
||||
}
|
||||
n++;
|
||||
ZEND_HASH_FILL_ADD(arg);
|
||||
} else {
|
||||
zval tmp;
|
||||
ZVAL_UNDEF(&tmp);
|
||||
ZEND_HASH_FILL_ADD(&tmp);
|
||||
ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -2339,9 +2336,10 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
if (Z_OPT_REFCOUNTED_P(p)) {
|
||||
Z_ADDREF_P(p);
|
||||
}
|
||||
n++;
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
} else {
|
||||
ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
@@ -2354,14 +2352,15 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
|
||||
if (Z_OPT_REFCOUNTED_P(p)) {
|
||||
Z_ADDREF_P(p);
|
||||
}
|
||||
n++;
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
} else {
|
||||
ZEND_HASH_FILL_ADD(&EG(uninitialized_zval));
|
||||
}
|
||||
ZEND_HASH_FILL_ADD(p);
|
||||
p++;
|
||||
i++;
|
||||
}
|
||||
} ZEND_HASH_FILL_END();
|
||||
Z_ARRVAL_P(arg_array)->nNumOfElements = n;
|
||||
Z_ARRVAL_P(arg_array)->nNumOfElements = num_args;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+14
-4
@@ -6455,7 +6455,11 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_string *filename = CG(compiled_filename);
|
||||
zend_string *dirname = zend_string_init(ZSTR_VAL(filename), ZSTR_LEN(filename), 0);
|
||||
#ifdef ZEND_WIN32
|
||||
php_win32_ioutil_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
|
||||
#else
|
||||
zend_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
|
||||
#endif
|
||||
|
||||
if (strcmp(ZSTR_VAL(dirname), ".") == 0) {
|
||||
dirname = zend_string_extend(dirname, MAXPATHLEN, 0);
|
||||
@@ -7370,8 +7374,11 @@ void zend_compile_class_const(znode *result, zend_ast *ast) /* {{{ */
|
||||
return;
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&class_ast);
|
||||
zend_eval_const_expr(&const_ast);
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
|
||||
class_ast = ast->child[0];
|
||||
const_ast = ast->child[1];
|
||||
|
||||
if (class_ast->kind == ZEND_AST_ZVAL) {
|
||||
zend_string *resolved_name;
|
||||
@@ -8309,8 +8316,11 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
break;
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&class_ast);
|
||||
zend_eval_const_expr(&name_ast);
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
|
||||
class_ast = ast->child[0];
|
||||
name_ast = ast->child[1];
|
||||
|
||||
if (name_ast->kind == ZEND_AST_ZVAL && zend_string_equals_literal_ci(zend_ast_get_str(name_ast), "class")) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
|
||||
+3
-10
@@ -1720,16 +1720,9 @@ fetch_from_array:
|
||||
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name));
|
||||
} else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) {
|
||||
if (!Z_ISREF_P(retval)) {
|
||||
if (Z_REFCOUNTED_P(retval) &&
|
||||
Z_REFCOUNT_P(retval) > 1) {
|
||||
if (Z_TYPE_P(retval) != IS_OBJECT) {
|
||||
Z_DELREF_P(retval);
|
||||
ZVAL_DUP(result, retval);
|
||||
retval = result;
|
||||
} else {
|
||||
ZVAL_COPY_VALUE(result, retval);
|
||||
retval = result;
|
||||
}
|
||||
if (result != retval) {
|
||||
ZVAL_COPY(result, retval);
|
||||
retval = result;
|
||||
}
|
||||
if (Z_TYPE_P(retval) != IS_OBJECT) {
|
||||
zend_class_entry *ce = Z_OBJCE_P(container);
|
||||
|
||||
@@ -108,7 +108,7 @@ static void zend_generator_cleanup_unfinished_execution(
|
||||
if (UNEXPECTED(generator->frozen_call_stack)) {
|
||||
zend_generator_restore_call_stack(generator);
|
||||
}
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, 0);
|
||||
zend_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -279,7 +279,6 @@ static uint32_t zend_array_recalc_elements(HashTable *ht)
|
||||
uint32_t num = ht->nNumOfElements;
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(ht, val) {
|
||||
if (Z_TYPE_P(val) == IS_UNDEF) continue;
|
||||
if (Z_TYPE_P(val) == IS_INDIRECT) {
|
||||
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
|
||||
num--;
|
||||
|
||||
@@ -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];
|
||||
char str_result[MAX_LENGTH_OF_LONG+1];
|
||||
|
||||
i_op1 = atoi(Z_STRVAL_P(op1));
|
||||
zend_string_free(Z_STR_P(op1));
|
||||
|
||||
@@ -122,11 +122,13 @@ struct _zend_module_dep {
|
||||
unsigned char type; /* dependency type */
|
||||
};
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
extern ZEND_API HashTable module_registry;
|
||||
|
||||
void module_destructor(zend_module_entry *module);
|
||||
int module_registry_request_startup(zend_module_entry *module);
|
||||
int module_registry_unload_temp(const zend_module_entry *module);
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -155,12 +155,12 @@ struct _zend_object_handlers {
|
||||
zend_object_compare_zvals_t compare;
|
||||
};
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
extern ZEND_API zend_object_handlers std_object_handlers;
|
||||
|
||||
#define zend_get_function_root_class(fbc) \
|
||||
((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
|
||||
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent);
|
||||
ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
|
||||
|
||||
+1
-1
@@ -2687,7 +2687,7 @@ EOF
|
||||
done
|
||||
|
||||
echo "'[$]0' \\" >> $1
|
||||
if test `expr -- [$]0 : "'.*"` = 0; then
|
||||
if test `expr " [$]0" : " '.*"` = 0; then
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]0'"
|
||||
else
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
|
||||
|
||||
+4
-1
@@ -29,5 +29,8 @@ if not exist "%SDK_RUNNER%" (
|
||||
exit /b 3
|
||||
)
|
||||
|
||||
call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
|
||||
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
exit /b 0
|
||||
|
||||
+11
-4
@@ -19,18 +19,25 @@ set STABILITY=staging
|
||||
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
|
||||
rem SDK is cached, deps info is cached as well
|
||||
echo Updating dependencies in %DEPS_DIR%
|
||||
call phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
|
||||
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
call buildconf.bat --force
|
||||
rem Something went wrong, most likely when concurrent builds were to fetch deps
|
||||
rem updates. It might be, that some locking mechanism is needed.
|
||||
if not exist "%DEPS_DIR%" (
|
||||
cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
|
||||
)
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
cmd /c buildconf.bat --force
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
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
|
||||
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba,ftp
|
||||
if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
|
||||
|
||||
call configure.bat ^
|
||||
cmd /c configure.bat ^
|
||||
--enable-snapshot-build ^
|
||||
--disable-debug-pack ^
|
||||
--with-mcrypt=shared ^
|
||||
|
||||
+4
-1
@@ -6,5 +6,8 @@ if not exist "%SDK_RUNNER%" (
|
||||
exit /b 3
|
||||
)
|
||||
|
||||
call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat
|
||||
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat
|
||||
if %errorlevel% neq 0 exit /b 3
|
||||
|
||||
exit /b 0
|
||||
|
||||
@@ -12,6 +12,10 @@ 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!
|
||||
@@ -25,6 +29,7 @@ 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
|
||||
@@ -33,12 +38,15 @@ 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=
|
||||
@@ -48,9 +56,13 @@ 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%
|
||||
@@ -73,3 +85,5 @@ 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%
|
||||
|
||||
+3
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=1
|
||||
PHP_RELEASE_VERSION=5
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=8
|
||||
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`
|
||||
|
||||
@@ -494,6 +494,7 @@ limits.h \
|
||||
locale.h \
|
||||
monetary.h \
|
||||
netdb.h \
|
||||
poll.h \
|
||||
pwd.h \
|
||||
resolv.h \
|
||||
signal.h \
|
||||
|
||||
+6181
-7085
File diff suppressed because it is too large.
Load diff
@@ -913,7 +913,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 ]*;
|
||||
datenoyear = monthtext ([ .\t-])* day ([,.stndrh\t ]+|[\000]);
|
||||
datenoyearrev = day ([ .\t-])* monthtext;
|
||||
datenocolon = year4 monthlz daylz;
|
||||
|
||||
|
||||
+25
-7
@@ -1998,7 +1998,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
zval *prop;
|
||||
int retval = 0;
|
||||
|
||||
if (Z_TYPE_P(member) != IS_STRING) {
|
||||
if (UNEXPECTED(Z_TYPE_P(member) != IS_STRING)) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
convert_to_string(&tmp_member);
|
||||
member = &tmp_member;
|
||||
@@ -2014,10 +2014,10 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
prop = date_interval_read_property(object, member, type, cache_slot, &rv);
|
||||
|
||||
if (prop != NULL) {
|
||||
|
||||
prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
|
||||
|
||||
if (prop != &EG(uninitialized_zval)) {
|
||||
if (type == 2) {
|
||||
retval = 1;
|
||||
} else if (type == 1) {
|
||||
@@ -2397,8 +2397,11 @@ static zend_object *date_object_clone_interval(zval *this_ptr) /* {{{ */
|
||||
php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0));
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, &old_obj->std);
|
||||
new_obj->initialized = old_obj->initialized;
|
||||
if (old_obj->diff) {
|
||||
new_obj->diff = timelib_rel_time_clone(old_obj->diff);
|
||||
}
|
||||
|
||||
/** FIX ME ADD CLONE STUFF **/
|
||||
return &new_obj->std;
|
||||
} /* }}} */
|
||||
|
||||
@@ -2481,8 +2484,23 @@ static zend_object *date_object_clone_period(zval *this_ptr) /* {{{ */
|
||||
php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0));
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, &old_obj->std);
|
||||
new_obj->initialized = old_obj->initialized;
|
||||
new_obj->recurrences = old_obj->recurrences;
|
||||
new_obj->include_start_date = old_obj->include_start_date;
|
||||
new_obj->start_ce = old_obj->start_ce;
|
||||
|
||||
/** FIX ME ADD CLONE STUFF **/
|
||||
if (old_obj->start) {
|
||||
new_obj->start = timelib_time_clone(old_obj->start);
|
||||
}
|
||||
if (old_obj->current) {
|
||||
new_obj->current = timelib_time_clone(old_obj->current);
|
||||
}
|
||||
if (old_obj->end) {
|
||||
new_obj->end = timelib_time_clone(old_obj->end);
|
||||
}
|
||||
if (old_obj->interval) {
|
||||
new_obj->interval = timelib_rel_time_clone(old_obj->interval);
|
||||
}
|
||||
return &new_obj->std;
|
||||
} /* }}} */
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ for ( $i = 0; $i < 1000; $i++ )
|
||||
}
|
||||
|
||||
var_dump($n = count( $collect ));
|
||||
echo ( $n > 800 ) ? "microseconds differ\n" : "microseconds do not differ enough ($n)\n";
|
||||
echo ( $n > 700 ) ? "microseconds differ\n" : "microseconds do not differ enough ($n)\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(%d)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #74639 Cloning DatePeriod leads to segfault
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$start = new DateTime('2017-05-22 09:00:00');
|
||||
$end = new DateTime('2017-08-24 18:00:00');
|
||||
$interval = $start->diff($end);
|
||||
|
||||
$period = new DatePeriod($start, $interval, $end);
|
||||
$clonedPeriod = clone $period;
|
||||
$clonedInterval = clone $interval;
|
||||
|
||||
if ($period->getStartDate() != $clonedPeriod->getStartDate()) {
|
||||
echo "failure\n";
|
||||
}
|
||||
|
||||
if ($period->getEndDate() != $clonedPeriod->getEndDate()) {
|
||||
echo "failure\n";
|
||||
}
|
||||
|
||||
if ($period->getDateInterval() != $clonedPeriod->getDateInterval()) {
|
||||
echo "failure\n";
|
||||
}
|
||||
|
||||
if ($interval->format('Y-m-d H:i:s') != $clonedInterval->format('Y-m-d H:i:s')) {
|
||||
echo "failure\n";
|
||||
}
|
||||
|
||||
echo 'success';
|
||||
?>
|
||||
--EXPECT--
|
||||
success
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Test for bug #74652: Incomplete dates
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
$formats = [
|
||||
'2017-03-25 10:52:09',
|
||||
'2017-03-25 10:52',
|
||||
'2017-03-25 10am',
|
||||
'2017-03-25',
|
||||
'2017-03',
|
||||
'2017.042',
|
||||
'2017043',
|
||||
];
|
||||
|
||||
foreach ( $formats as $format )
|
||||
{
|
||||
$dt = new DateTimeImmutable( $format );
|
||||
echo $dt->format( 'Y-m-d H:i:s' ), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
2017-03-25 10:52:09
|
||||
2017-03-25 10:52:00
|
||||
2017-03-25 10:00:00
|
||||
2017-03-25 00:00:00
|
||||
2017-03-01 00:00:00
|
||||
2017-02-11 00:00:00
|
||||
2017-02-12 00:00:00
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #74852 property_exists returns true on unknown DateInterval property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P2D');
|
||||
var_dump(property_exists($interval,'abcde'));
|
||||
var_dump(isset($interval->abcde));
|
||||
var_dump($interval->abcde);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Notice: Undefined property: DateInterval::$abcde in %s on line %d
|
||||
NULL
|
||||
@@ -34,14 +34,14 @@ foreach ( $tests as $start => $data )
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
Sat, 23 Oct 2010 00:00:00 +0000
|
||||
Fri, 15 Oct 2010 23: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
|
||||
Sat, 23 Oct 2010 00:00:00 +0100
|
||||
Fri, 15 Oct 2010 23: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,6 +337,8 @@ 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:
|
||||
@@ -854,6 +856,14 @@ 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 *) "");
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--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,6 +147,9 @@ 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.
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,27 @@
|
||||
--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===
|
||||
@@ -88,6 +88,10 @@ ZEND_BEGIN_ARG_INFO_EX( collator_sort_args, 0, 0, 1 )
|
||||
ZEND_ARG_INFO( 0, flags )
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX( collator_sort_with_sort_keys_args, 0, 0, 1 )
|
||||
ZEND_ARG_ARRAY_INFO( 1, arr, 0 )
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ Collator_class_functions
|
||||
@@ -99,7 +103,7 @@ zend_function_entry Collator_class_functions[] = {
|
||||
ZEND_FENTRY( create, ZEND_FN( collator_create ), collator_1_arg, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
|
||||
PHP_NAMED_FE( compare, ZEND_FN( collator_compare ), collator_2_args )
|
||||
PHP_NAMED_FE( sort, ZEND_FN( collator_sort ), collator_sort_args )
|
||||
PHP_NAMED_FE( sortWithSortKeys, ZEND_FN( collator_sort_with_sort_keys ), collator_sort_args )
|
||||
PHP_NAMED_FE( sortWithSortKeys, ZEND_FN( collator_sort_with_sort_keys ), collator_sort_with_sort_keys_args )
|
||||
PHP_NAMED_FE( asort, ZEND_FN( collator_asort ), collator_sort_args )
|
||||
PHP_NAMED_FE( getAttribute, ZEND_FN( collator_get_attribute ), collator_1_arg )
|
||||
PHP_NAMED_FE( setAttribute, ZEND_FN( collator_set_attribute ), collator_2_args )
|
||||
@@ -108,7 +112,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_2_args )
|
||||
PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_1_arg )
|
||||
PHP_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -110,6 +110,7 @@ PHP_FUNCTION( msgfmt_parse_message )
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
INTL_CHECK_LOCALE_LEN(slocale_len);
|
||||
memset(mfo, 0, sizeof(*mfo));
|
||||
msgformat_data_init(&mfo->mf_data);
|
||||
|
||||
|
||||
+7
-2
@@ -154,6 +154,11 @@ ZEND_BEGIN_ARG_INFO_EX(collator_sort_args, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, sort_flags)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(collator_sort_with_sort_keys_args, 0, 0, 2)
|
||||
ZEND_ARG_OBJ_INFO(0, coll, Collator, 0)
|
||||
ZEND_ARG_ARRAY_INFO(1, arr, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_arginfo, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, formatter)
|
||||
ZEND_ARG_INFO(0, string)
|
||||
@@ -629,12 +634,12 @@ zend_function_entry intl_functions[] = {
|
||||
PHP_FE( collator_get_strength, collator_0_args )
|
||||
PHP_FE( collator_set_strength, collator_1_arg )
|
||||
PHP_FE( collator_sort, collator_sort_args )
|
||||
PHP_FE( collator_sort_with_sort_keys, collator_sort_args )
|
||||
PHP_FE( collator_sort_with_sort_keys, collator_sort_with_sort_keys_args )
|
||||
PHP_FE( collator_asort, collator_sort_args )
|
||||
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_2_args )
|
||||
PHP_FE( collator_get_sort_key, collator_1_arg )
|
||||
|
||||
/* formatter functions */
|
||||
PHP_FE( numfmt_create, arginfo_numfmt_create )
|
||||
|
||||
@@ -13,7 +13,7 @@ var_dump((new \IntlDateFormatter(
|
||||
'UTC',
|
||||
\IntlDateFormatter::GREGORIAN,
|
||||
'yyyy-MM-dd HH:mm:ss.SSSSSS'
|
||||
))->format(new \DateTime('2017-01-01 01:02:03.123456')));
|
||||
))->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
|
||||
|
||||
var_dump(datefmt_create(
|
||||
'en-US',
|
||||
@@ -22,7 +22,7 @@ var_dump(datefmt_create(
|
||||
'UTC',
|
||||
\IntlDateFormatter::GREGORIAN,
|
||||
'yyyy-MM-dd HH:mm:ss.SSSSSS'
|
||||
)->format(new \DateTime('2017-01-01 01:02:03.123456')));
|
||||
)->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(26) "2017-01-01T01:02:03.123456"
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #74468 Wrong reflection on Collator::sortWithSortKeys
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$rm = new ReflectionMethod(Collator::class, 'sortWithSortKeys');
|
||||
var_dump($rm->getNumberOfParameters());
|
||||
var_dump($rm->getNumberOfRequiredParameters());
|
||||
|
||||
$rf = new ReflectionFunction('collator_sort_with_sort_keys');
|
||||
var_dump($rf->getNumberOfParameters());
|
||||
var_dump($rf->getNumberOfRequiredParameters());
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
int(2)
|
||||
int(2)
|
||||
===DONE===
|
||||
@@ -0,0 +1,21 @@
|
||||
--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===
|
||||
@@ -19,8 +19,8 @@ var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, 'pt_PT'));
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
string(30) "Western European Standard Time"
|
||||
string(30) "Western European Standard Time"
|
||||
string(32) "Hora Padrão da Europa Ocidental"
|
||||
string(32) "Hora %cadrão da Europa Ocidental"
|
||||
==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.14.3
|
||||
re2c 0.16
|
||||
Bison 3.0.4
|
||||
|
||||
It is recommended to do all contributions to the JSON extension
|
||||
|
||||
+644
-713
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 */
|
||||
/* Generated by re2c 0.16 */
|
||||
|
||||
enum YYCONDTYPE {
|
||||
yycJS,
|
||||
|
||||
+2
-2
@@ -415,7 +415,7 @@ PHP_FUNCTION(ldap_connect)
|
||||
{
|
||||
int rc = LDAP_SUCCESS;
|
||||
char *url = host;
|
||||
if (!ldap_is_ldap_url(url)) {
|
||||
if (url && !ldap_is_ldap_url(url)) {
|
||||
int urllen = hostlen + sizeof( "ldap://:65535" );
|
||||
|
||||
if (port <= 0 || port > 65535) {
|
||||
@@ -425,7 +425,7 @@ PHP_FUNCTION(ldap_connect)
|
||||
}
|
||||
|
||||
url = emalloc(urllen);
|
||||
snprintf( url, urllen, "ldap://%s:" ZEND_LONG_FMT, host ? host : "", port );
|
||||
snprintf( url, urllen, "ldap://%s:" ZEND_LONG_FMT, host, port );
|
||||
}
|
||||
|
||||
#ifdef LDAP_API_FEATURE_X_OPENLDAP
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
--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)
|
||||
}
|
||||
}
|
||||
|
||||
static void php_libxml_node_free_list(xmlNodePtr node)
|
||||
PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node)
|
||||
{
|
||||
xmlNodePtr curnode;
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ 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,14 +1425,9 @@ 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;
|
||||
|
||||
@@ -3128,6 +3123,8 @@ 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);
|
||||
}
|
||||
}
|
||||
@@ -3208,7 +3205,13 @@ 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 (*low > s) {
|
||||
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) {
|
||||
*low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
|
||||
*low, (const UChar** )low_prev);
|
||||
if (low_prev && IS_NULL(*low_prev))
|
||||
@@ -3221,6 +3224,7 @@ 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) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (num < 0 || num >= 256) 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) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
|
||||
if (p == prev) { /* can't read nothing. */
|
||||
num = 0; /* but, it's not error */
|
||||
}
|
||||
@@ -4068,7 +4068,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
|
||||
}
|
||||
}
|
||||
|
||||
*state = CCS_VALUE;
|
||||
if (*state != CCS_START)
|
||||
*state = CCS_VALUE;
|
||||
|
||||
*type = CCV_CLASS;
|
||||
return 0;
|
||||
}
|
||||
@@ -4084,7 +4086,11 @@ 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;
|
||||
|
||||
@@ -619,7 +619,7 @@ PHP_FUNCTION(mysqli_change_user)
|
||||
const CHARSET_INFO * old_charset;
|
||||
#endif
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
+30
-6
@@ -261,6 +261,17 @@ ZEND_END_ARG_INFO()
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_query, 0, 0, 2)
|
||||
MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
|
||||
ZEND_ARG_INFO(0, query)
|
||||
ZEND_ARG_INFO(0, resultmode)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_multi_query, 0, 0, 1)
|
||||
MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
|
||||
ZEND_ARG_INFO(0, query)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_real_query, 0, 0, 1)
|
||||
MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
|
||||
ZEND_ARG_INFO(0, query)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_prepare, 0, 0, 2)
|
||||
@@ -275,6 +286,19 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_query, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, query)
|
||||
ZEND_ARG_INFO(0, resultmode)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_prepare, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, query)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_multi_query, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, query)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_query, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, query)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_options, 0, 0, 3)
|
||||
@@ -442,7 +466,7 @@ const zend_function_entry mysqli_functions[] = {
|
||||
PHP_FE(mysqli_insert_id, arginfo_mysqli_only_link)
|
||||
PHP_FE(mysqli_kill, arginfo_mysqli_kill)
|
||||
PHP_FE(mysqli_more_results, arginfo_mysqli_only_link)
|
||||
PHP_FE(mysqli_multi_query, arginfo_mysqli_query)
|
||||
PHP_FE(mysqli_multi_query, arginfo_mysqli_multi_query)
|
||||
PHP_FE(mysqli_next_result, arginfo_mysqli_only_link)
|
||||
PHP_FE(mysqli_num_fields, arginfo_mysqli_only_result)
|
||||
PHP_FE(mysqli_num_rows, arginfo_mysqli_only_result)
|
||||
@@ -456,7 +480,7 @@ const zend_function_entry mysqli_functions[] = {
|
||||
PHP_FE(mysqli_query, arginfo_mysqli_query)
|
||||
PHP_FE(mysqli_real_connect, arginfo_mysqli_real_connect)
|
||||
PHP_FE(mysqli_real_escape_string, arginfo_mysqli_real_escape_string)
|
||||
PHP_FE(mysqli_real_query, arginfo_mysqli_query)
|
||||
PHP_FE(mysqli_real_query, arginfo_mysqli_real_query)
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
PHP_FE(mysqli_reap_async_query, arginfo_mysqli_only_link)
|
||||
#endif
|
||||
@@ -542,7 +566,7 @@ const zend_function_entry mysqli_link_methods[] = {
|
||||
PHP_FALIAS(get_warnings, mysqli_get_warnings, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(init,mysqli_init_method, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(kill,mysqli_kill, arginfo_class_mysqli_kill)
|
||||
PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_query)
|
||||
PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_multi_query)
|
||||
PHP_FALIAS(__construct, mysqli_link_construct, arginfo_mysqli_connect)
|
||||
PHP_FALIAS(more_results, mysqli_more_results, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(next_result, mysqli_next_result, arginfo_mysqli_no_params)
|
||||
@@ -551,7 +575,7 @@ const zend_function_entry mysqli_link_methods[] = {
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
ZEND_FENTRY(poll, ZEND_FN(mysqli_poll), arginfo_mysqli_poll, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
|
||||
#endif
|
||||
PHP_FALIAS(prepare, mysqli_prepare, arginfo_class_mysqli_query)
|
||||
PHP_FALIAS(prepare, mysqli_prepare, arginfo_class_mysqli_prepare)
|
||||
PHP_FALIAS(query, mysqli_query, arginfo_class_mysqli_query)
|
||||
PHP_FALIAS(real_connect, mysqli_real_connect, arginfo_class_mysqli_real_connect)
|
||||
PHP_FALIAS(real_escape_string, mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string)
|
||||
@@ -559,7 +583,7 @@ const zend_function_entry mysqli_link_methods[] = {
|
||||
PHP_FALIAS(reap_async_query, mysqli_reap_async_query, arginfo_mysqli_no_params)
|
||||
#endif
|
||||
PHP_FALIAS(escape_string, mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string)
|
||||
PHP_FALIAS(real_query, mysqli_real_query, arginfo_class_mysqli_query)
|
||||
PHP_FALIAS(real_query, mysqli_real_query, arginfo_class_mysqli_real_query)
|
||||
PHP_FALIAS(release_savepoint, mysqli_release_savepoint, arginfo_class_mysqli_release_savepoint)
|
||||
PHP_FALIAS(rollback, mysqli_rollback, arginfo_class_mysqli_rollback)
|
||||
PHP_FALIAS(savepoint, mysqli_savepoint, arginfo_class_mysqli_savepoint)
|
||||
@@ -628,7 +652,7 @@ const zend_function_entry mysqli_stmt_methods[] = {
|
||||
PHP_FALIAS(send_long_data, mysqli_stmt_send_long_data, arginfo_class_mysqli_stmt_send_long_data)
|
||||
PHP_FALIAS(free_result, mysqli_stmt_free_result, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(reset, mysqli_stmt_reset, arginfo_mysqli_no_params)
|
||||
PHP_FALIAS(prepare, mysqli_stmt_prepare, arginfo_class_mysqli_query)
|
||||
PHP_FALIAS(prepare, mysqli_stmt_prepare, arginfo_class_mysqli_prepare)
|
||||
PHP_FALIAS(store_result, mysqli_stmt_store_result, arginfo_mysqli_no_params)
|
||||
#if defined(MYSQLI_USE_MYSQLND)
|
||||
PHP_FALIAS(get_result, mysqli_stmt_get_result, arginfo_mysqli_no_params)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once("connect.inc");
|
||||
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
var_dump(mysqli_change_user($link, $user, $passwd, NULL));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #74595 (ReflectionMethod::getParameters returns incorrect number of parameters)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$class = new ReflectionClass('mysqli');
|
||||
$method = $class->getMethod('query');
|
||||
var_dump($method->getParameters());
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
[0]=>
|
||||
object(ReflectionParameter)#%d (1) {
|
||||
["name"]=>
|
||||
string(5) "query"
|
||||
}
|
||||
[1]=>
|
||||
object(ReflectionParameter)#%d (1) {
|
||||
["name"]=>
|
||||
string(10) "resultmode"
|
||||
}
|
||||
}
|
||||
@@ -732,7 +732,7 @@ isInternal: yes
|
||||
isUserDefined: no
|
||||
returnsReference: no
|
||||
Modifiers: 256
|
||||
Number of Parameters: 1
|
||||
Number of Parameters: 2
|
||||
Number of Required Parameters: 1
|
||||
|
||||
Inspecting parameter 'query' of method 'query'
|
||||
@@ -742,6 +742,13 @@ isPassedByReference: no
|
||||
isOptional: no
|
||||
isDefaultValueAvailable: no
|
||||
|
||||
Inspecting parameter 'resultmode' of method 'query'
|
||||
isArray: no
|
||||
allowsNull: no
|
||||
isPassedByReference: no
|
||||
isOptional: yes
|
||||
isDefaultValueAvailable: no
|
||||
|
||||
Inspecting method 'real_connect'
|
||||
isFinal: no
|
||||
isAbstract: no
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #74432, BC issue on undocumented connect string
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* This behavior is undocumented, but might be in use. Until there's no officially
|
||||
supported alternative, ensure changes doesn't cause BC breach. Otherwise,
|
||||
the test should be removed once the undocumented behavior changes. */
|
||||
|
||||
require_once("connect.inc");
|
||||
|
||||
$handle = mysqli_connect("$host:$port", $user, $passwd);
|
||||
|
||||
var_dump($handle);
|
||||
|
||||
if ($handle) {
|
||||
mysqli_close($handle);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(mysqli)#%d (%d) {
|
||||
%A
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ if (!$IS_MYSQLND)
|
||||
|
||||
function poll_async($offset, $link, $links, $errors, $reject, $exp_ready, $use_oo_syntax) {
|
||||
|
||||
if ($exp_ready !== ($tmp = mysqli_poll($links, $errors, $reject, 0, 1000)))
|
||||
if ($exp_ready !== ($tmp = mysqli_poll($links, $errors, $reject, 0, 2000)))
|
||||
printf("[%03d + 1] There should be %d links ready to read from, %d ready\n",
|
||||
$offset, $exp_ready, $tmp);
|
||||
|
||||
|
||||
+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, $ext_shared)
|
||||
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.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, $ext_shared)
|
||||
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.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', null, null, null, "ext\\oci8_11g")
|
||||
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")
|
||||
|
||||
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', null, null, null, "ext\\oci8_12c")
|
||||
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")
|
||||
|
||||
AC_DEFINE('HAVE_OCI8', 1);
|
||||
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
|
||||
|
||||
@@ -504,6 +504,11 @@ 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 */
|
||||
@@ -701,6 +706,7 @@ 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
|
||||
@@ -783,6 +789,7 @@ 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)
|
||||
@@ -1129,6 +1136,20 @@ 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;
|
||||
}
|
||||
|
||||
@@ -1930,6 +1951,7 @@ 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
|
||||
@@ -1944,6 +1966,7 @@ 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
|
||||
@@ -1952,6 +1975,7 @@ 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
|
||||
@@ -2225,6 +2249,15 @@ 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;
|
||||
@@ -2667,6 +2700,11 @@ 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()) {
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| 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,6 +42,39 @@
|
||||
#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!!! */
|
||||
@@ -1553,6 +1586,9 @@ 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); */
|
||||
|
||||
|
||||
+16
-15
@@ -38,6 +38,13 @@
|
||||
#include "php_oci8.h"
|
||||
#include "php_oci8_int.h"
|
||||
|
||||
#if defined(OCI_MAJOR_VERSION) && (OCI_MAJOR_VERSION > 10) && \
|
||||
(defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64))
|
||||
typedef ub8 oci_phpsized_int;
|
||||
#else
|
||||
typedef ub4 oci_phpsized_int;
|
||||
#endif
|
||||
|
||||
/* {{{ php_oci_statement_create()
|
||||
Create statemend handle and allocate necessary resources */
|
||||
php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char *query, int query_len)
|
||||
@@ -997,10 +1004,10 @@ int php_oci_bind_post_exec(zval *data)
|
||||
for (i = 0; i < (int) bind->array.current_length; i++) {
|
||||
if ((i < (int) bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
|
||||
zval_dtor(entry);
|
||||
ZVAL_LONG(entry, ((ub4 *)(bind->array.elements))[i]);
|
||||
ZVAL_LONG(entry, ((oci_phpsized_int *)(bind->array.elements))[i]);
|
||||
zend_hash_move_forward(hash);
|
||||
} else {
|
||||
add_next_index_long(bind->zval, ((ub4 *)(bind->array.elements))[i]);
|
||||
add_next_index_long(bind->zval, ((oci_phpsized_int *)(bind->array.elements))[i]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1153,14 +1160,8 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
|
||||
return 1;
|
||||
}
|
||||
convert_to_long(param);
|
||||
#if defined(OCI_MAJOR_VERSION) && (OCI_MAJOR_VERSION > 10) && \
|
||||
(defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64))
|
||||
bind_data = (ub8 *)&Z_LVAL_P(param);
|
||||
value_sz = sizeof(ub8);
|
||||
#else
|
||||
bind_data = (ub4 *)&Z_LVAL_P(param);
|
||||
value_sz = sizeof(ub4);
|
||||
#endif
|
||||
bind_data = (oci_phpsized_int *)&Z_LVAL_P(param);
|
||||
value_sz = sizeof(oci_phpsized_int);
|
||||
mode = OCI_DEFAULT;
|
||||
break;
|
||||
|
||||
@@ -1783,10 +1784,10 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
|
||||
|
||||
bind = emalloc(sizeof(php_oci_bind));
|
||||
ZVAL_UNDEF(&bind->parameter);
|
||||
bind->array.elements = (ub4 *)safe_emalloc(max_table_length, sizeof(ub4), 0);
|
||||
bind->array.elements = (oci_phpsized_int *)safe_emalloc(max_table_length, sizeof(oci_phpsized_int), 0);
|
||||
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
|
||||
bind->array.old_length = bind->array.current_length;
|
||||
bind->array.max_length = sizeof(ub4);
|
||||
bind->array.max_length = sizeof(oci_phpsized_int);
|
||||
bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0);
|
||||
memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2));
|
||||
bind->array.indicators = NULL;
|
||||
@@ -1794,14 +1795,14 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
|
||||
zend_hash_internal_pointer_reset(hash);
|
||||
for (i = 0; i < max_table_length; i++) {
|
||||
if (i < bind->array.current_length) {
|
||||
bind->array.element_lengths[i] = sizeof(ub4);
|
||||
bind->array.element_lengths[i] = sizeof(oci_phpsized_int);
|
||||
}
|
||||
if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
|
||||
convert_to_long_ex(entry);
|
||||
((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_P(entry);
|
||||
((oci_phpsized_int *)bind->array.elements)[i] = (oci_phpsized_int) Z_LVAL_P(entry);
|
||||
zend_hash_move_forward(hash);
|
||||
} else {
|
||||
((ub4 *)bind->array.elements)[i] = 0;
|
||||
((oci_phpsized_int *)bind->array.elements)[i] = 0;
|
||||
}
|
||||
}
|
||||
zend_hash_internal_pointer_reset(hash);
|
||||
|
||||
+38
-4
@@ -46,12 +46,12 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<active>no</active>
|
||||
</lead>
|
||||
|
||||
<date>2017-04-12</date>
|
||||
<date>2017-06-20</date>
|
||||
<time>12:00:00</time>
|
||||
|
||||
<version>
|
||||
<release>2.1.4</release>
|
||||
<api>2.1.4</api>
|
||||
<release>2.1.6</release>
|
||||
<api>2.1.6</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
@@ -60,7 +60,7 @@ Interoperability Support" (ID 207303.1) for details.
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Fixed uninitialized data causing random crash
|
||||
Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
</notes>
|
||||
<contents>
|
||||
<dir name="/">
|
||||
@@ -164,6 +164,7 @@ Fixed uninitialized data causing random crash
|
||||
<file name="bug71422.phpt" role="test" />
|
||||
<file name="bug71600.phpt" role="test" />
|
||||
<file name="bug72524.phpt" role="test" />
|
||||
<file name="bug74625.phpt" role="test" />
|
||||
<file name="clientversion.phpt" role="test" />
|
||||
<file name="close.phpt" role="test" />
|
||||
<file name="coll_001.phpt" role="test" />
|
||||
@@ -447,6 +448,7 @@ 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" />
|
||||
@@ -468,6 +470,38 @@ 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.4</release>
|
||||
<api>2.1.4</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://www.php.net/license">PHP</license>
|
||||
<notes>
|
||||
This version is for PHP 7 only.
|
||||
Fixed uninitialized data causing random crash
|
||||
</notes>
|
||||
</release>
|
||||
|
||||
<release>
|
||||
<version>
|
||||
<release>2.1.3</release>
|
||||
|
||||
+2
-1
@@ -43,11 +43,12 @@
|
||||
*/
|
||||
#undef PHP_OCI8_VERSION
|
||||
#endif
|
||||
#define PHP_OCI8_VERSION "2.1.4"
|
||||
#define PHP_OCI8_VERSION "2.1.6"
|
||||
|
||||
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,6 +164,8 @@ 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;
|
||||
/* }}} */
|
||||
|
||||
@@ -531,6 +533,13 @@ 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
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
--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
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
--TEST--
|
||||
Bug #74625 (Integer overflow in oci_bind_array_by_name)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('oci8')) die ("skip no oci8 extension");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require(dirname(__FILE__).'/connect.inc');
|
||||
|
||||
// Initialization
|
||||
|
||||
$stmtarray = array(
|
||||
"CREATE TABLE bug74625_tab (NAME NUMBER)",
|
||||
"CREATE OR REPLACE PACKAGE PKG74625 AS
|
||||
TYPE ARRTYPE IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
|
||||
PROCEDURE iobind(c1 IN OUT ARRTYPE);
|
||||
END PKG74625;",
|
||||
"CREATE OR REPLACE PACKAGE BODY PKG74625 AS
|
||||
PROCEDURE iobind(c1 IN OUT ARRTYPE) IS
|
||||
BEGIN
|
||||
FOR i IN 1..5 LOOP
|
||||
c1(i) := c1(i) * 2;
|
||||
END LOOP;
|
||||
END iobind;
|
||||
END PKG74625;"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
$statement = oci_parse($c, "BEGIN pkg74625.iobind(:c1); END;");
|
||||
|
||||
$array = Array(-1,-2,-3,-4,-5);
|
||||
|
||||
oci_bind_array_by_name($statement, ":c1", $array, 5, -1, SQLT_INT);
|
||||
|
||||
oci_execute($statement);
|
||||
|
||||
var_dump($array);
|
||||
|
||||
// Cleanup
|
||||
$stmtarray = array(
|
||||
"DROP TABLE bug74625_tab",
|
||||
"DROP PACKAGE PKG74625"
|
||||
);
|
||||
|
||||
oci8_test_sql_execute($c, $stmtarray);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
<?php exit(0); ?>
|
||||
--EXPECTF--
|
||||
array(5) {
|
||||
[0]=>
|
||||
int(-2)
|
||||
[1]=>
|
||||
int(-4)
|
||||
[2]=>
|
||||
int(-6)
|
||||
[3]=>
|
||||
int(-8)
|
||||
[4]=>
|
||||
int(-10)
|
||||
}
|
||||
===DONE===
|
||||
@@ -29,7 +29,7 @@ echo "Test 1\n";
|
||||
|
||||
// Make errors throw exceptions
|
||||
|
||||
set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);'));
|
||||
set_error_handler(function($x, $y) { throw new Exception($y, $x); });
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ echo "Test 1\n";
|
||||
|
||||
// Make errors throw exceptions
|
||||
|
||||
set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);'));
|
||||
set_error_handler(function($x, $y) { throw new Exception($y, $x); });
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ echo "Test 1\n";
|
||||
|
||||
// Make errors throw exceptions
|
||||
|
||||
set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);'));
|
||||
set_error_handler(function($x, $y) { throw new Exception($y, $x); });
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ echo "Test 1\n";
|
||||
|
||||
// Make errors throw exceptions
|
||||
|
||||
set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);'));
|
||||
set_error_handler(function($x, $y) { throw new Exception($y, $x); });
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ echo "Test 1\n";
|
||||
|
||||
// Make errors throw exceptions
|
||||
|
||||
set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);'));
|
||||
set_error_handler(function($x, $y) { throw new Exception($y, $x); });
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ echo "Test 1\n";
|
||||
|
||||
// Make errors throw exceptions
|
||||
|
||||
set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);'));
|
||||
set_error_handler(function($x, $y) { throw new Exception($y, $x); });
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -57,11 +57,11 @@ function get_attr($conn)
|
||||
?>
|
||||
--EXPECT--
|
||||
**Test 1.1 - Default values for the attribute **************
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.3
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
|
||||
|
||||
***Test 1.2 - Get the values from different connections **************
|
||||
Testing with oci_pconnect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.3
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
|
||||
Testing with oci_new_connect()
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.3
|
||||
The value of DRIVER_NAME is PHP OCI8 : 2.1.6
|
||||
Done
|
||||
@@ -109,6 +109,7 @@ void zend_optimize_temporary_variables(zend_op_array *op_array, zend_optimizer_c
|
||||
*/
|
||||
if ((op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) &&
|
||||
(opline->opcode == ZEND_RETURN ||
|
||||
opline->opcode == ZEND_GENERATOR_RETURN ||
|
||||
opline->opcode == ZEND_RETURN_BY_REF ||
|
||||
opline->opcode == ZEND_FREE ||
|
||||
opline->opcode == ZEND_FE_FREE)) {
|
||||
|
||||
@@ -493,7 +493,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);
|
||||
|
||||
@@ -1753,8 +1753,11 @@ static int zend_infer_ranges(const zend_op_array *op_array, zend_ssa *ssa) /* {{
|
||||
} \
|
||||
} \
|
||||
if (ssa_var_info[__var].type != __type) { \
|
||||
check_type_narrowing(op_array, ssa, worklist, \
|
||||
__var, ssa_var_info[__var].type, __type); \
|
||||
if (ssa_var_info[__var].type & ~__type) { \
|
||||
handle_type_narrowing(op_array, ssa, worklist, \
|
||||
__var, ssa_var_info[__var].type, __type); \
|
||||
return FAILURE; \
|
||||
} \
|
||||
ssa_var_info[__var].type = __type; \
|
||||
add_usages(op_array, ssa, worklist, __var); \
|
||||
} \
|
||||
@@ -1891,15 +1894,17 @@ static void reset_dependent_vars(const zend_op_array *op_array, zend_ssa *ssa, z
|
||||
#endif
|
||||
}
|
||||
|
||||
static void check_type_narrowing(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset worklist, int var, uint32_t old_type, uint32_t new_type)
|
||||
static void handle_type_narrowing(const zend_op_array *op_array, zend_ssa *ssa, zend_bitset worklist, int var, uint32_t old_type, uint32_t new_type)
|
||||
{
|
||||
/* if new_type set resets some bits from old_type set
|
||||
* We have completely recalculate types of some dependent SSA variables
|
||||
* (this may occurs mainly because of incremental inter-precudure
|
||||
* type inference)
|
||||
*/
|
||||
if (old_type & ~new_type) {
|
||||
ZEND_ASSERT(0); /* Currently this should never happen */
|
||||
if (1) {
|
||||
/* Right now, this is always a bug */
|
||||
zend_error(E_WARNING, "Narrowing occurred during type inference. Please file a bug report on bugs.php.net");
|
||||
} else {
|
||||
/* if new_type set resets some bits from old_type set
|
||||
* We have completely recalculate types of some dependent SSA variables
|
||||
* (this may occurs mainly because of incremental inter-precudure
|
||||
* type inference)
|
||||
*/
|
||||
reset_dependent_vars(op_array, ssa, worklist, var);
|
||||
}
|
||||
}
|
||||
@@ -2125,7 +2130,7 @@ static uint32_t zend_fetch_arg_info(const zend_script *script, zend_arg_info *ar
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static void zend_update_type_info(const zend_op_array *op_array,
|
||||
static int zend_update_type_info(const zend_op_array *op_array,
|
||||
zend_ssa *ssa,
|
||||
const zend_script *script,
|
||||
zend_bitset worklist,
|
||||
@@ -3104,7 +3109,7 @@ static void zend_update_type_info(const zend_op_array *op_array,
|
||||
opline->opcode == ZEND_FETCH_OBJ_RW ||
|
||||
opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) {
|
||||
if (opline->opcode != ZEND_FETCH_DIM_FUNC_ARG) {
|
||||
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_NULL)) {
|
||||
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
|
||||
tmp &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
|
||||
tmp |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
|
||||
}
|
||||
@@ -3219,6 +3224,8 @@ unknown_opcode:
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static uint32_t get_class_entry_rank(zend_class_entry *ce) {
|
||||
@@ -3329,7 +3336,9 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
|
||||
}
|
||||
} else if (ssa_vars[j].definition >= 0) {
|
||||
i = ssa_vars[j].definition;
|
||||
zend_update_type_info(op_array, ssa, script, worklist, i);
|
||||
if (zend_update_type_info(op_array, ssa, script, worklist, i) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
} WHILE_WORKLIST_END();
|
||||
return SUCCESS;
|
||||
|
||||
@@ -960,6 +960,17 @@ 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 */
|
||||
@@ -1712,7 +1723,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
}
|
||||
persistent_script = zend_accel_hash_str_find(&ZCSG(hash), key, key_length);
|
||||
} else if (UNEXPECTED(is_stream_path(file_handle->filename) && !is_cacheable_stream_path(file_handle->filename))) {
|
||||
return accelerator_orig_compile_file(file_handle, type);
|
||||
}
|
||||
|
||||
if (!persistent_script) {
|
||||
/* try to find cached script by full real path */
|
||||
zend_accel_hash_entry *bucket;
|
||||
|
||||
@@ -310,6 +310,7 @@ 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 accelerator_shm_read_lock(void);
|
||||
void accelerator_shm_read_unlock(void);
|
||||
|
||||
@@ -221,8 +221,10 @@ 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;
|
||||
|
||||
@@ -275,7 +277,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, 0, requested_size,
|
||||
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, size_high, size_low,
|
||||
create_name_with_username(ACCEL_FILEMAP_NAME));
|
||||
if (memfile == NULL) {
|
||||
err = GetLastError();
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
--TEST--
|
||||
Bug #74596 (SIGSEGV with opcache.revalidate_path enabled)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.validate_timestamps=0
|
||||
opcache.file_cache_only=0
|
||||
opcache.revalidate_path=1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
file_put_contents(__DIR__ . "/bug74596_1.php", <<<CODE
|
||||
<?php
|
||||
class A {
|
||||
public function __construct() {
|
||||
\$a = true;
|
||||
if (\$a) {
|
||||
echo 1 + 2;
|
||||
} else {
|
||||
echo 2 + 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
CODE
|
||||
);
|
||||
|
||||
file_put_contents(__DIR__ . "/bug74596_2.php", "ok\n");
|
||||
|
||||
class ufilter extends php_user_filter
|
||||
{
|
||||
function filter($in, $out, &$consumed, $closing)
|
||||
{
|
||||
include_once __DIR__ . "/bug74596_1.php";
|
||||
while ($bucket = stream_bucket_make_writeable($in)) {
|
||||
stream_bucket_append($out, $bucket);
|
||||
}
|
||||
return PSFS_PASS_ON;
|
||||
}
|
||||
}
|
||||
|
||||
stream_filter_register("ufilter", "ufilter");
|
||||
|
||||
include "php://filter/read=ufilter/resource=" . __DIR__ . "/bug74596_2.php";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . "/bug74596_1.php");
|
||||
unlink(__DIR__ . "/bug74596_2.php");
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #74623: Infinite loop in type inference when using HTMLPurifier
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function crash($arr) {
|
||||
$current_item = false;
|
||||
|
||||
foreach($arr as $item) {
|
||||
if($item->name === 'string') {
|
||||
$current_item = $item;
|
||||
} else {
|
||||
$current_item->a[] = '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,25 @@
|
||||
--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)
|
||||
@@ -304,7 +304,7 @@ ZEND_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("opcache.optimization_level" , DEFAULT_OPTIMIZATION_LEVEL , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.optimization_level, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.opt_debug_level" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.opt_debug_level, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_BOOLEAN("opcache.enable_file_override" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_override_enabled, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "1" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.error_log" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.error_log, zend_accel_globals, accel_globals)
|
||||
STD_PHP_INI_ENTRY("opcache.restrict_api" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.restrict_api, zend_accel_globals, accel_globals)
|
||||
|
||||
@@ -342,7 +342,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(persistent_script, &handle) == SUCCESS;
|
||||
return validate_timestamp_and_record_ex(persistent_script, &handle) == SUCCESS;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
+69
-48
@@ -87,6 +87,14 @@
|
||||
#define HAVE_EVP_PKEY_EC 1
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r")
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w")
|
||||
#else
|
||||
#define PHP_OPENSSL_BIO_MODE_R(flags) "r"
|
||||
#define PHP_OPENSSL_BIO_MODE_W(flags) "w"
|
||||
#endif
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(openssl)
|
||||
|
||||
/* FIXME: Use the openssl constants instead of
|
||||
@@ -669,6 +677,11 @@ 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)
|
||||
@@ -838,9 +851,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++) {
|
||||
unsigned char *to_add = NULL;
|
||||
const unsigned char *to_add = NULL;
|
||||
int to_add_len = 0;
|
||||
int needs_free = 0;
|
||||
unsigned char *to_add_buf = NULL;
|
||||
|
||||
ne = X509_NAME_get_entry(name, i);
|
||||
obj = X509_NAME_ENTRY_get_object(ne);
|
||||
@@ -855,34 +868,36 @@ 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, str);
|
||||
needs_free = 1;
|
||||
to_add_len = ASN1_STRING_to_UTF8(&to_add_buf, str);
|
||||
to_add = to_add_buf;
|
||||
} else {
|
||||
/* 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);
|
||||
/* 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);
|
||||
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, (char *)to_add, to_add_len);
|
||||
add_next_index_stringl(data, (const 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, (char *)to_add, to_add_len);
|
||||
add_next_index_stringl(&tmp, (const 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);
|
||||
}
|
||||
} else {
|
||||
php_openssl_store_errors();
|
||||
}
|
||||
|
||||
if (needs_free) {
|
||||
/* ASN1_STRING_to_UTF8(3): The buffer out should be freed using free(3) */
|
||||
OPENSSL_free(to_add);
|
||||
if (to_add_buf != NULL) {
|
||||
OPENSSL_free(to_add_buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -921,7 +936,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_data(timestr))) {
|
||||
if (timestr_len != strlen((const char *)ASN1_STRING_get0_data(timestr))) {
|
||||
php_error_docref(NULL, E_WARNING, "illegal length in timestamp");
|
||||
return (time_t)-1;
|
||||
}
|
||||
@@ -936,7 +951,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
|
||||
return (time_t)-1;
|
||||
}
|
||||
|
||||
strbuf = estrdup((char *)ASN1_STRING_data(timestr));
|
||||
strbuf = estrdup((const char *)ASN1_STRING_get0_data(timestr));
|
||||
|
||||
memset(&thetime, 0, sizeof(thetime));
|
||||
|
||||
@@ -1496,6 +1511,7 @@ PHP_MINIT_FUNCTION(openssl)
|
||||
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_RAW_DATA", OPENSSL_RAW_DATA, CONST_CS|CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_ZERO_PADDING", OPENSSL_ZERO_PADDING, CONST_CS|CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("OPENSSL_DONT_ZERO_PAD_KEY", OPENSSL_DONT_ZERO_PAD_KEY, CONST_CS|CONST_PERSISTENT);
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
/* SNI support included */
|
||||
@@ -1845,21 +1861,19 @@ 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 (keyresource == NULL && spki != NULL) {
|
||||
if (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;
|
||||
@@ -2046,7 +2060,7 @@ PHP_FUNCTION(openssl_spki_export_challenge)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge));
|
||||
RETVAL_STRING((const char *)ASN1_STRING_get0_data(spki->spkac->challenge));
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
@@ -2237,19 +2251,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_data(as),
|
||||
BIO_write(bio, ASN1_STRING_get0_data(as),
|
||||
ASN1_STRING_length(as));
|
||||
break;
|
||||
case GEN_DNS:
|
||||
BIO_puts(bio, "DNS:");
|
||||
as = name->d.dNSName;
|
||||
BIO_write(bio, ASN1_STRING_data(as),
|
||||
BIO_write(bio, ASN1_STRING_get0_data(as),
|
||||
ASN1_STRING_length(as));
|
||||
break;
|
||||
case GEN_URI:
|
||||
BIO_puts(bio, "URI:");
|
||||
as = name->d.uniformResourceIdentifier;
|
||||
BIO_write(bio, ASN1_STRING_data(as),
|
||||
BIO_write(bio, ASN1_STRING_get0_data(as),
|
||||
ASN1_STRING_length(as));
|
||||
break;
|
||||
default:
|
||||
@@ -2941,6 +2955,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
|
||||
|
||||
if (d2i_PKCS12_bio(bio_in, &p12) && PKCS12_parse(p12, pass, &pkey, &cert, &ca)) {
|
||||
BIO * bio_out;
|
||||
int cert_num;
|
||||
|
||||
zval_dtor(zout);
|
||||
array_init(zout);
|
||||
@@ -2971,10 +2986,11 @@ PHP_FUNCTION(openssl_pkcs12_read)
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
|
||||
if (ca && sk_X509_num(ca)) {
|
||||
cert_num = sk_X509_num(ca);
|
||||
if (ca && cert_num) {
|
||||
array_init(&zextracerts);
|
||||
|
||||
for (i = 0; i < sk_X509_num(ca); i++) {
|
||||
for (i = 0; i < cert_num; i++) {
|
||||
zval zextracert;
|
||||
X509* aCA = sk_X509_pop(ca);
|
||||
if (!aCA) break;
|
||||
@@ -2988,6 +3004,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
|
||||
}
|
||||
|
||||
X509_free(aCA);
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
|
||||
sk_X509_free(ca);
|
||||
@@ -4998,7 +5015,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
in = BIO_new_file(filename, (flags & PKCS7_BINARY) ? "rb" : "r");
|
||||
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(flags));
|
||||
if (in == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5110,7 +5127,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
|
||||
return;
|
||||
}
|
||||
|
||||
infile = BIO_new_file(infilename, "r");
|
||||
infile = BIO_new_file(infilename, PHP_OPENSSL_BIO_MODE_R(flags));
|
||||
if (infile == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5268,7 +5285,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
infile = BIO_new_file(infilename, "r");
|
||||
infile = BIO_new_file(infilename, PHP_OPENSSL_BIO_MODE_R(flags));
|
||||
if (infile == NULL) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "error opening input file %s!", infilename);
|
||||
@@ -5371,12 +5388,12 @@ PHP_FUNCTION(openssl_pkcs7_decrypt)
|
||||
goto clean_exit;
|
||||
}
|
||||
|
||||
in = BIO_new_file(infilename, "r");
|
||||
in = BIO_new_file(infilename, PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY));
|
||||
if (in == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
}
|
||||
out = BIO_new_file(outfilename, "w");
|
||||
out = BIO_new_file(outfilename, PHP_OPENSSL_BIO_MODE_W(PKCS7_BINARY));
|
||||
if (out == NULL) {
|
||||
php_openssl_store_errors();
|
||||
goto clean_exit;
|
||||
@@ -5910,7 +5927,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) ||
|
||||
if (EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) <= 0 ||
|
||||
!EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, (int)data_len) ||
|
||||
!EVP_SealFinal(ctx, buf + len1, &len2)) {
|
||||
efree(buf);
|
||||
@@ -6214,9 +6231,7 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir
|
||||
|
||||
if (mode->is_aead) {
|
||||
if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_ivlen_flag, *piv_len, NULL) != 1) {
|
||||
php_error_docref(NULL, E_WARNING,
|
||||
"Setting of IV length for AEAD mode failed, the expected length is %zd bytes",
|
||||
iv_required_len);
|
||||
php_error_docref(NULL, E_WARNING, "Setting of IV length for AEAD mode failed");
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
@@ -6266,20 +6281,7 @@ static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
|
||||
int key_len, password_len;
|
||||
size_t max_iv_len;
|
||||
|
||||
/* check and set key */
|
||||
password_len = (int) *ppassword_len;
|
||||
key_len = EVP_CIPHER_key_length(cipher_type);
|
||||
if (key_len > password_len) {
|
||||
key = emalloc(key_len);
|
||||
memset(key, 0, key_len);
|
||||
memcpy(key, *ppassword, password_len);
|
||||
*ppassword = (char *) key;
|
||||
*ppassword_len = key_len;
|
||||
*free_password = 1;
|
||||
} else {
|
||||
key = (unsigned char*)*ppassword;
|
||||
*free_password = 0;
|
||||
}
|
||||
*free_password = 0;
|
||||
|
||||
max_iv_len = EVP_CIPHER_iv_length(cipher_type);
|
||||
if (enc && *piv_len == 0 && max_iv_len > 0 && !mode->is_aead) {
|
||||
@@ -6304,9 +6306,28 @@ static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
if (password_len > key_len && !EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len)) {
|
||||
php_openssl_store_errors();
|
||||
/* check and set key */
|
||||
password_len = (int) *ppassword_len;
|
||||
key_len = EVP_CIPHER_key_length(cipher_type);
|
||||
if (key_len > password_len) {
|
||||
if ((OPENSSL_DONT_ZERO_PAD_KEY & options) && !EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len)) {
|
||||
php_openssl_store_errors();
|
||||
php_error_docref(NULL, E_WARNING, "Key length cannot be set for the cipher method");
|
||||
return FAILURE;
|
||||
}
|
||||
key = emalloc(key_len);
|
||||
memset(key, 0, key_len);
|
||||
memcpy(key, *ppassword, password_len);
|
||||
*ppassword = (char *) key;
|
||||
*ppassword_len = key_len;
|
||||
*free_password = 1;
|
||||
} else {
|
||||
if (password_len > key_len && !EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len)) {
|
||||
php_openssl_store_errors();
|
||||
}
|
||||
key = (unsigned char*)*ppassword;
|
||||
}
|
||||
|
||||
if (!EVP_CipherInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)*piv, enc)) {
|
||||
php_openssl_store_errors();
|
||||
return FAILURE;
|
||||
|
||||
@@ -31,6 +31,7 @@ extern zend_module_entry openssl_module_entry;
|
||||
|
||||
#define OPENSSL_RAW_DATA 1
|
||||
#define OPENSSL_ZERO_PADDING 2
|
||||
#define OPENSSL_DONT_ZERO_PAD_KEY 4
|
||||
|
||||
#define OPENSSL_ERROR_X509_PRIVATE_KEY_VALUES_MISMATCH 0x0B080074
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
-----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-----
|
||||
@@ -10,7 +10,7 @@ if (OPENSSL_VERSION_NUMBER < 0x009070af) die("skip");
|
||||
$configargs = array(
|
||||
"req_extensions" => "v3_req",
|
||||
"x509_extensions" => "usr_cert",
|
||||
"config" => __DIR__."/openssl.cnf",
|
||||
"config" => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf",
|
||||
);
|
||||
|
||||
$dn = array(
|
||||
|
||||
@@ -19,7 +19,7 @@ $csr_info = array(
|
||||
$private = openssl_pkey_new($config);
|
||||
while (openssl_error_string()) {}
|
||||
$csr_res = openssl_csr_new($csr_info, $private,
|
||||
['config' => __DIR__."/openssl.cnf"]);
|
||||
['config' => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf"]);
|
||||
if (!$csr_res) {
|
||||
while ($e = openssl_error_string()) { $err = $e; }
|
||||
die("Failed; last error: $err");
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #71917: openssl_open() returns junk on envelope < 16 bytes
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
function test($envkey) {
|
||||
$publicKey = "file://" . dirname(__FILE__) . "/public.key";
|
||||
$privateKey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
|
||||
openssl_public_encrypt($envkey, $envelope, $publicKey);
|
||||
$sealed = openssl_encrypt('plaintext', 'rc4', $envkey, OPENSSL_RAW_DATA | OPENSSL_DONT_ZERO_PAD_KEY);
|
||||
openssl_open($sealed, $output, $envelope, $privateKey, 'rc4');
|
||||
var_dump($output === 'plaintext');
|
||||
}
|
||||
|
||||
// works - key of 16 bytes
|
||||
test('1234567890123456i');
|
||||
// fails - key of 15 bytes
|
||||
test('123456789012345');
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #72362: OpenSSL Blowfish encryption is incorrect for short keys
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(bin2hex(openssl_encrypt("this is a test string","bf-ecb","12345678", OPENSSL_RAW_DATA | OPENSSL_DONT_ZERO_PAD_KEY)));
|
||||
var_dump(bin2hex(openssl_encrypt("this is a test string","bf-ecb","1234567812345678" , OPENSSL_RAW_DATA)));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(48) "e3214d1b16e574828c8a3e222202dde81afd1ad2cb165ab3"
|
||||
string(48) "e3214d1b16e574828c8a3e222202dde81afd1ad2cb165ab3"
|
||||
@@ -7,11 +7,12 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
--FILE--
|
||||
<?php
|
||||
$passwords = ["abc\x00defghijkl", "abcdefghikjl"];
|
||||
$conf = ['config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'];
|
||||
|
||||
foreach($passwords as $password) {
|
||||
$key = openssl_pkey_new();
|
||||
$key = openssl_pkey_new($conf);
|
||||
|
||||
if (openssl_pkey_export($key, $privatePEM, $password) === false) {
|
||||
if (openssl_pkey_export($key, $privatePEM, $password, $conf) === false) {
|
||||
echo "Failed to encrypt.\n";
|
||||
} else {
|
||||
echo "Encrypted!\n";
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #74022 PHP Fast CGI crashes when reading from a pfx file with valid password, multiple extra certs
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
function test($p12_contents, $password) {
|
||||
openssl_pkcs12_read($p12_contents, $cert_data, $password);
|
||||
openssl_error_string();
|
||||
var_dump(count($cert_data['extracerts']));
|
||||
}
|
||||
|
||||
$p12_base64 = 'MIIW+QIBAzCCFr8GCSqGSIb3DQEHAaCCFrAEghasMIIWqDCCEV8GCSqGSIb3DQEHBqCCEVAwghFMAgEAMIIRRQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIQOfCxIAgGIICAggAgIIRGFTkvHpJjCtFjukXYVlhyOIqKiS8Zvg84dX244hhI0S51Uyn/tlXM2GD/3hDNVxcVKwP/fKN21lEkoXoK4h2/5BY3qCdZa3Ef3vk44b/+FGCUAqvsOo1ZjD2P/sBGhLu3aFnQ6ktUXlKV4cnqhlF62AqY4e5efQzmJXn+gI8cSNI5c+qQ0RQgGoRY4nJfvMSZG0/DAkirjGikU/2TZd8LwLkxVUBYbF5/T0fNtA3o99+4tF+8ZRv6ArYjplRdwcBbMbzGhn3ytCq6cmVid9iLjwHJFmvAPXKbmu0Lh5eRRznX9gBWlzGd08Q/ch0MW2ehZTu1A2VrNWl+FKWSk8l0MlSoTPJFutFiejRvMr6VzbQItyJ/mtrNa9b1Hicgoj9HaBB6arx4wKORlbSOxFNOWdTCUhFdqthK5o7b9i/owyVgyY0s7BFEZChc0zGpRq7BLrynY79b+pHKzpil9isuisp1++piHZx9Y/bpC7OP5FlYF9+3TJL0EpEFQD8FqEoqcMFRxIDWGpCQiLGcmL14OH1JKSgOJEAgogsIF/KQhvWeKcUSJlai+0sskl8mOrCt2EJwuRvzmemuzebYN3JMOiBXKONYR0yU8AeAyNTgSBimWhACtikUyfpgZXlIeXyFMvj9fmd0I/zqjaW4upqrCudCOj/CWx7+e+8udfJxI7agWwrZMf1BEkOhRFOHOIuV+IEbaoMP6vVrGlhK71oN+gnoes5ivohpFDJWSZ3+1fMh56vfNynuM2wLJO7FTROPla+4ug33V/2ubGpoIyXn2lTSbuXaYDfsXMa1inakOMW9Q+PHGdIjZrwQU/u9Q2H0IlwFd4uQojZo15SRf4xh5FOuUrrfGRAnp1mWHALTBqd2VnkgqtBl8rXZXqA+CiEhEDhTAQmvf+wCKd3FklrhV+p65YcfRK9OJv5aFQM1/+WbJozF4/Wi5j4rtIDPrgMMEflOyoZIxGxDOaklyAvaasRU2TT8E2LIEvGKOzlrhIZqWyRESjgXdh6l0UBMaVAidIZ0JLf+8fqSZ0Zia5iAaJpm82MQr/PVXC4lqqxDlHhefwM3OKfZVkfAw0a2eePM5YkIxAgMpAstBt32UIixlj/5l4MwqzP8Reb4MsV6Fph2e14vsV1diLBaJI3hrU5UBVEDWV0GSbwdhZLtdubSaBHcv5v9aZ1cdFKL6d2rHksW9ooNnh/ljPxmVlfHbb8sPYDXmLmBNJdNV1gQouhKKrt0ov1J9+sqE53D9+9dfRwf/myYlnyNgqU4vNMrZI2flyugkYoUxIC8stVF46zfL5QkSg3GqdLQC4gpeJ0WdTSyOBaOgUvqGdSARb5bXm1VXF5IxVg1B4v+puNIHS9yuphXUJvw6xWWPjbQAllDrPjMqAbxmF465vFyQP0qEvMjRD+SaFIgW4KjMqfteKo4MgqKTRF4UP9r0HkwRErOznxWDfSxzXYztY6U72NdifN9IIFiBikKQqZvfvaN+1jukehSRpGQHQB5OxeeKThJZJGiUC5Fgvl7lPb6Djx8Rfba/FJvVsR2KFS64sArtUKmC6LcJxEY9WcsiJTHek817zvYej7FD1NxuttNp+ue9ArOoIhOEf08HIOu3d2yjeRlN5CJ/jIdKYlZW6m6Ap1M+OUHhJTF73K6lKKD9Diwa3s6FoqOwtZF4uYwHnCG218BMY8GgEVD73x5KjDOP02Y6EakZNp/9QIqQT4WkMWXMaqAPADtoh8X1FJLlnvs2Ko+hLlPxuPaIA4KvSuuocnWx/6HJbdqHUS/Se+JJo0Igt4Svax1R2kvoIPuQmPmHJ6l7CeZZiNbe+baFSx+V6g/6AgHUsUOSqGvUIEns1uIE9CQ8w0G3yLVonjERJLrdj+em3Pt7fxrxoOI4nwjplX0wJk0rkQREiS8ULQDHueptUcxJxMKpugAc4CL+BsHohkhm4kpOEmviKDwzxytQhDp2Fj2PRO9kqyNrNfzNGCN5709blEIVYTtonELI2vR5Ap+O2pH+AlqrnHWgeOYAKAyWT13xCNRsGNdv2sCDDiHqxq01IBzYhPvoWzECOmGbJRRSGOVzYCJJpVjl0NNKv9ucmftSQRjm6xgLIqv1xrehDYuJ/IMsYQ5QwXBGxy7nkeRg+onWzA0ZnEWgzLs3T/Pj7z/TPQWiN03MH24RvQXTWBqp9iBwXpsCZVgUIM/VLCQJn0/V5gfRy9Ne0rk2/tHMnzGHvll5Spoy6WkxSfQ8c8CjTilaoPWV6fOcNB2Z6ZuTqX0fbnxcEAu2fOK7e6ryGipEgaxrdiopDTlgPEFMdGUETbUh0ACrv/gNsS+m5MtNisWnhxFEiXrsWoWIgW/6TgRJGo+l52bh/xxC0bwHbYuHK62sxDVeXpBOnA4VE+WckWsC0CKYJvv4vfTbLI46fyd3lnlcSuHYM4SdbND7THNeK+KB5GyuUFLgAhhtZv8ceEo63IOlBUUy1NlWnr0cbidxvVnOugFLExCV5QGr+xbrssIibQxs8AfOBK8Cxh83IlzJVe7dX1mZVG1c6AM6SKSC6F0LBOeNEvcLlz4PBMIciubCE6ecdXCzJYFbj9ERDlnrZMKrnATRMsgCPaWdyYgQwkDuCj5uqf4aiKLzA61918hLY3MB7mSyJcCkXDYKr11Br0YSAdu8uG6IjpiUQS2PFz8E8XHBmO/uobhEuCPR2LnUv+xFN8zoPQlA5ueRz1yBF8L+CsvDGp/N3KF26ETWlvmnEdt7foE+o/J7aG6xO/CNB+/+yGbVPZRVAntZec9nbqlQ55qECnWtQNnShW7+3RSGamWeTtE2DyRSfd/62JkPNEY25jbBUIkMNtKolA5dbYa+u50S3lvakMmvQvzcSC3PONajKHgk4mBn3qf9X2uM5RDL83M7489r6JPcxTnNK27rQoxplkxLiN8HuB+AB5hp82WoyvLydR4hoBnJPIYKMcmEfIR+SgLoCyNIQLjzk5Iyk1ZwdwsjyNPXi1/HHZq8+NhoTCupjGfWgXghoz89MTYAjpMvOlES2rgFuCdphSc8Nd1uQtZx4CLMOU0gut0PI81ePBBI0iG74PWMEcp5HlHHY/hPTaRkBFLYkq9CWmJc1PfjiCWf3pwRmT7dUnmcptynexIMOZt2Nd76jc+g7k5MmEK+Qdz7/c1un4sVLquxdY6nUY/znLz+2zC/OTSsF39+rak3p8TXR0kBNsHl8UTioi4CGhCMsWsQy9me25TDHzbtIvBPVp9xXufsOe2wqPLjq3iNEGXTsagx3sLvl7BJ6WW/YMC7sUpjx1Ai3zkqViW0jQB+BzMZjfYM/8Yj31EEE+WssxY+NfitBgZzeMGGjNOAKp7XN0glwhuo1G2/APyU/Zopx3gMYj5OExgkZ7kvK++7+NlPmE+8AEuZ/uf30TtKwvRXOSvAMqqm26kb/WQPCj1xFQ0AEDl0Sbyfgk1E51Cd/ujL0t32FNkSoE8pe3IaTnwAnW7NHTZ/RByh2nsr0ThfFg4pFFuSD4dzU8r2J/4YJG3B06eyyTRLoyLBQwzwIgzGBAU8USdD8CXlA8SkfBbF39500ZRNcMIt6wdQa1CHAUHDLPw9JF9Q0FwCspgkjc9+lTRZMtumN5ChgypSkUB1dzLV2hqeQzDngVjcco/CoxM0Svm8gGrM9qobCTGzGF8/wZljv1yRiqu6HGFYWDAQ/p+wWx6ScstxEAB+5R5GrOedgd4zPXi2NMvyeN+ACFRBSPkhXIXpLZADvBi/WQMYbHia1wL8WUrSGQuB4P46cWGyseaxl//6GQ9IoGbK3XuLIPeE+BpPLB0H9LSLY+5f3qOEkKzCCW0z+68ZMlanlsThLKhqk8yrmJhV4788Tr7BC3eGbAie1urrrfUR613Jsp5peLSJuWQHdWCE/fdKgoSsRJ+DYkPoyS1YNz4BF4yz1Oem9Mti7gvgTQNX6g6PCu0rN8B6HIgY9TvWy5OCoZjJKasb+OgTMld7TJDnyK5/JcvDKHNVwcpK74lxcVX7IRorP/eh4IQ1+P/Gh06A62RHp2dEh/fNuKeCiRM2vGH0gdIN/Ca6MX8MqazgJq2EONyWiqRoGPqqZpAVTa8l5kgGvxQE/CQ4x0uAxwresRRTUZ+fJEanAhTWYgI5mRoEkG88UZjyCWmCnpNMQRYHoq7iY0So5qUdkHvpUA48cNMyztPEEHsUyWC36ZCyNsQN26FoJrG9TqXedBrhcki0sPOWugvKtGsdTT354wJTDe5OCo0AH3eFo/auuuAk/DF7yu614UCmKtXHYJ61GpIkjBu9WrPAIJhndMqfGMD/yU4UMEPHyojqHvU0BSgv1k76vI3K2lqERkaNYFfzRNj+e7k+NNos8w7XCzilWBL2ePB3pG5xfivcH4tYFm0FbnIkSz52VIy+PTiK7QQuBPDRTcn1k41+9vxQxRWpsqM/NP+4gqGozNyANXLQ64Y+QXSnWrD+xMjL/kVFwUBJ2HaAIJHjZ7ZqLRzXVOUbQ9pivJiBkXvLptSo72Iw4zsbRd1x8WNEaihx1MBAj+s+4MNdC5MBkQMlSB0PTJzs9xlz0gN+Oz0lohH6JO7ngPJUYbo2AIWEYZN+9kn/RyHblQTElrJeLf1jGNi4anBfzbsIXQuVm/nsrE5MH23X66+rJzUk8Fc5JAIDGBslkDPg3UNnElcE3cYbcB/ZzjFtgz8ducWKQmI+Yqv4p7BVXji/rHPim8vL6P5xZc95tbIonp5bQH+PPSmcfDk3rrf5mS58dJvWh/UpwcfdVvUAsWLJEV1lUBg1qecVbCsa6Oy7tJ2ZK7e3KdtZrmXiYpSAnSzRNJotr4g4H99brG6IwUx3qk5BE4Line truncated
|
||||
|
||||
$p12 = base64_decode($p12_base64);
|
||||
|
||||
test($p12, 'qwerty');
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
int(2)
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
--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)
|
||||
Loaded 100 of 226 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user