mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-20 15:36:37 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7603abbc51 | ||
|
|
4ae24d9250 | ||
|
|
bf393c89d8 | ||
|
|
f251b16fcc | ||
|
|
5904e1e55e | ||
|
|
bef6df6a7e | ||
|
|
c3771929b7 | ||
|
|
7dce9533e7 | ||
|
|
8c3093d660 | ||
|
|
3592dce76d | ||
|
|
6922659b8b | ||
|
|
f44cd92cd2 | ||
|
|
dc87efa848 | ||
|
|
6787bfc37d | ||
|
|
bce433e422 | ||
|
|
e0e19a12be | ||
|
|
a6601cb692 | ||
|
|
a5e68f72a7 | ||
|
|
04c9271805 | ||
|
|
c22543b3f3 | ||
|
|
a32c8ba719 | ||
|
|
1add8401a3 | ||
|
|
059e774db0 | ||
|
|
0a8f28b432 | ||
|
|
2d3868984c | ||
|
|
ffbd380e44 | ||
|
|
133c57198e | ||
|
|
97a1b34300 | ||
|
|
346c8f7331 | ||
|
|
2c117a40a7 | ||
|
|
0c1c7c7ecb | ||
|
|
b3d4790976 | ||
|
|
96e33a7e98 | ||
|
|
e5fd3fc99d | ||
|
|
90329a32dc | ||
|
|
1bc77559f3 | ||
|
|
8654fdd884 | ||
|
|
639f92275a | ||
|
|
b7389f0f07 | ||
|
|
a4490bb0a2 | ||
|
|
6480725007 | ||
|
|
a24aefaac2 | ||
|
|
3c22449649 | ||
|
|
6de25c155e | ||
|
|
64d9c98fa9 | ||
|
|
90a8b59e9c | ||
|
|
8f7e378b9f | ||
|
|
3a660bf3a5 | ||
|
|
ef52e44053 | ||
|
|
f4264ebc64 | ||
|
|
a04ab4b54b | ||
|
|
1b2d58a364 | ||
|
|
ebce0d5d5a | ||
|
|
67c5ad6b6a | ||
|
|
bc0e5051e3 | ||
|
|
d380d1cb1b | ||
|
|
7461c52248 | ||
|
|
c9550e81da | ||
|
|
1b41dcf9c5 | ||
|
|
8f9cb39cad | ||
|
|
3924548bcb | ||
|
|
1174b399ad | ||
|
|
eb98366642 | ||
|
|
3ab1513ac9 | ||
|
|
23520d7957 | ||
|
|
3eb893396a | ||
|
|
86bbacfd53 | ||
|
|
0e1024f25a | ||
|
|
76c1ec5e96 | ||
|
|
c2ec4f90d2 | ||
|
|
8fe9715d05 | ||
|
|
a52385fc02 | ||
|
|
3342a248a2 | ||
|
|
5b5742c016 | ||
|
|
a1bca171d2 | ||
|
|
6f5ed34d20 | ||
|
|
7a41574239 | ||
|
|
57f835e148 | ||
|
|
c12e031530 | ||
|
|
aa22e80b1a | ||
|
|
c2e22556ba | ||
|
|
3e7f47cb03 | ||
|
|
4076a4d2a9 | ||
|
|
c6384a7908 | ||
|
|
1badfd8171 | ||
|
|
fce9a856e7 | ||
|
|
723ffe2e89 | ||
|
|
968fbc6acf | ||
|
|
fb83c76dee | ||
|
|
40037f1474 | ||
|
|
0c27a8eb61 | ||
|
|
1ec430d4ed | ||
|
|
63d7cd7d5b | ||
|
|
a759c40872 | ||
|
|
d33636f764 | ||
|
|
7fce3607ea | ||
|
|
a73d0b0fb3 | ||
|
|
d025f8e019 | ||
|
|
b98a486606 | ||
|
|
b5d7bcf0db | ||
|
|
95c3a4798f | ||
|
|
9ff99059b1 | ||
|
|
d55b42bd61 | ||
|
|
b70ba86781 | ||
|
|
ceb4cb6976 | ||
|
|
eebd7c66ee | ||
|
|
72c19d8260 | ||
|
|
95b9c34f02 | ||
|
|
a0927357a3 | ||
|
|
b20b0ffe4e | ||
|
|
8f18444cd9 | ||
|
|
0c3de98368 | ||
|
|
9bdbc7490f | ||
|
|
51856a76f8 | ||
|
|
56cda02e11 | ||
|
|
9bbf9fedff | ||
|
|
c824de432d | ||
|
|
df340b5d8e | ||
|
|
61d11d7e10 | ||
|
|
6a4399a8d9 | ||
|
|
3eba942eb2 | ||
|
|
4680f08607 | ||
|
|
c7dfd8a3a4 | ||
|
|
9744aded1a | ||
|
|
6262db7341 | ||
|
|
5e4dd962e2 | ||
|
|
58efcc7dd8 | ||
|
|
de0cee2f39 | ||
|
|
4c3b73b6df | ||
|
|
225cb973e5 | ||
|
|
210cfafc2b | ||
|
|
53eff4a369 | ||
|
|
ef8fc4b53d | ||
|
|
749f82af02 | ||
|
|
14588c2499 | ||
|
|
bf2f03ddb3 | ||
|
|
890b3987ab | ||
|
|
c83dd84ad6 | ||
|
|
fb04dcf6db | ||
|
|
8b14d3052f | ||
|
|
dbd1d79b68 | ||
|
|
6264f81a21 | ||
|
|
33a5532b66 | ||
|
|
d5e523f52f | ||
|
|
646572d6d3 | ||
|
|
3d00867bba | ||
|
|
3dfccd7ba5 | ||
|
|
4a2e613730 | ||
|
|
bfb669891e | ||
|
|
3477568b4e | ||
|
|
34418222d7 | ||
|
|
9ba4db5e5d | ||
|
|
e55e40ca66 | ||
|
|
1291d6bbee | ||
|
|
f040b48358 | ||
|
|
a6a58dddc3 | ||
|
|
0f18a15e89 | ||
|
|
2a50877428 | ||
|
|
4dba99c226 | ||
|
|
8f898c0706 | ||
|
|
293d6e629d | ||
|
|
af2b066911 | ||
|
|
2ac31872ac | ||
|
|
c21c8f369d | ||
|
|
846c8059e6 | ||
|
|
1e51c5411e | ||
|
|
96bb3b838c | ||
|
|
5b87d52041 | ||
|
|
669c7104c3 | ||
|
|
396bc00caa | ||
|
|
ed59370f0a | ||
|
|
1b5ad03f66 | ||
|
|
4b930e156f | ||
|
|
a9d73f0646 | ||
|
|
482500b455 | ||
|
|
950d3d6e9b | ||
|
|
8cc8d4830a | ||
|
|
6b643f0741 | ||
|
|
c661121459 | ||
|
|
d4f727d0f8 | ||
|
|
675606f1a6 | ||
|
|
3f6b12795c | ||
|
|
49bd45a2c1 | ||
|
|
bc9f2fb8df | ||
|
|
b52a2940af | ||
|
|
c814b3294a | ||
|
|
25050e3b00 | ||
|
|
f074870f4e | ||
|
|
b5589d3fb4 | ||
|
|
6f4af2da29 | ||
|
|
0584b2df3f | ||
|
|
abb09693ac | ||
|
|
6a6c273893 | ||
|
|
f6762192d2 | ||
|
|
22894e74c2 | ||
|
|
69691cc8ca | ||
|
|
bbfd4a5e62 | ||
|
|
4ca14f681e | ||
|
|
9af1383a3f | ||
|
|
711ee5e4e1 | ||
|
|
b0ec8dfd0d | ||
|
|
66a2c528fe | ||
|
|
0f333fa93c | ||
|
|
934d6ed900 | ||
|
|
7d47d9fe23 | ||
|
|
7684d72df8 | ||
|
|
fa72f1ea86 | ||
|
|
a8da0a9620 | ||
|
|
43b426fbc4 | ||
|
|
dcc031470a | ||
|
|
a2a20d29a8 | ||
|
|
b0d1e23646 | ||
|
|
d7931f8f66 | ||
|
|
43da0d302b | ||
|
|
89f86119d6 | ||
|
|
0928bad9ac | ||
|
|
469b5a9584 | ||
|
|
d7fb52ea20 | ||
|
|
e82878a200 | ||
|
|
10bc5fd4c4 | ||
|
|
e7df9d710c | ||
|
|
ca24d19a89 | ||
|
|
33828f002d | ||
|
|
c985ec737d | ||
|
|
010f17534f | ||
|
|
e892f5382f | ||
|
|
d4d05c8919 | ||
|
|
5939de35a8 | ||
|
|
94140afa69 | ||
|
|
0f334a1265 | ||
|
|
e8e5913e5e | ||
|
|
869f8bd24b | ||
|
|
7bcdbcf98e | ||
|
|
56f9dc2d59 | ||
|
|
168be6f250 | ||
|
|
f039225597 | ||
|
|
eaa1b3e614 | ||
|
|
65a9a5ca12 | ||
|
|
1de1ff75f5 | ||
|
|
5dcace058a | ||
|
|
ca766e0787 | ||
|
|
3c2c029bfd | ||
|
|
241f3c34b8 | ||
|
|
a29b64fc10 | ||
|
|
6183408031 | ||
|
|
837eeefee9 | ||
|
|
808e562f23 | ||
|
|
6cb3b941df | ||
|
|
304fb7a3d6 | ||
|
|
860fc3947f | ||
|
|
c433f19a6b | ||
|
|
b3ac352253 | ||
|
|
c8eaca013a | ||
|
|
5c03e05692 | ||
|
|
66c883c0fd | ||
|
|
26827a0111 | ||
|
|
035d80523f | ||
|
|
0c136a2abd | ||
|
|
f353162ca2 | ||
|
|
bb466d57ae | ||
|
|
4e2c87edb3 | ||
|
|
34f09b6240 | ||
|
|
dea7bc8786 | ||
|
|
fc1f24b7a6 | ||
|
|
d5248f67b5 | ||
|
|
169ac35c66 | ||
|
|
672a396d4a | ||
|
|
caebb76131 | ||
|
|
1a35c959a9 | ||
|
|
aaaa905912 | ||
|
|
041b472d6f | ||
|
|
55f7747bff | ||
|
|
214350f4f4 | ||
|
|
c98eb695b5 | ||
|
|
6ef477f947 | ||
|
|
8b0cf0d7fa | ||
|
|
1b240ff9e3 | ||
|
|
f824f91ac9 | ||
|
|
b41b229d78 | ||
|
|
e9c6798721 | ||
|
|
4119879a39 | ||
|
|
86ba1a2444 | ||
|
|
997b7e5630 | ||
|
|
578903578c | ||
|
|
4eb830b212 | ||
|
|
414bc8ee03 | ||
|
|
d377cb6207 | ||
|
|
ebfc49aa91 | ||
|
|
4b83d02b4b | ||
|
|
cfaf7c3b5f | ||
|
|
3e82816ba1 | ||
|
|
2d1a3ecd27 | ||
|
|
e441d71baa | ||
|
|
65810bf259 | ||
|
|
f13a88ac13 | ||
|
|
8584cc010a | ||
|
|
9502d67a8e | ||
|
|
34d397e267 | ||
|
|
d3615b5fb1 | ||
|
|
d508ff9640 | ||
|
|
d05575afd0 | ||
|
|
9641bac0f5 | ||
|
|
ffdc5728c8 | ||
|
|
caacaee681 | ||
|
|
5256ffd4fe | ||
|
|
1bfbb546f7 | ||
|
|
63ab6d8249 | ||
|
|
ee2f749a22 | ||
|
|
d5a1a3342b | ||
|
|
97d809a8a5 | ||
|
|
591dbcabe5 | ||
|
|
7ea5b3f71c | ||
|
|
ffd2fda0f3 | ||
|
|
a9ba407ce1 | ||
|
|
e12b72d3f7 | ||
|
|
98959f6220 | ||
|
|
871d51929b | ||
|
|
8f6a013c97 | ||
|
|
e656932d0e | ||
|
|
68afd75ecd | ||
|
|
7988f703f8 | ||
|
|
3cf2b7cc2b | ||
|
|
6751f8b314 | ||
|
|
c4c3dca302 | ||
|
|
b21d0848c9 | ||
|
|
3082177bee | ||
|
|
95be012dce | ||
|
|
46e5f0c6bb | ||
|
|
6393556a5d | ||
|
|
13c3b78f1e | ||
|
|
c111d1cd70 | ||
|
|
f4c96ffcb5 | ||
|
|
90421b0d5b | ||
|
|
9fb48edf3c | ||
|
|
97dd859c9c | ||
|
|
d58e76fd69 | ||
|
|
3d777c8068 | ||
|
|
73a9c701ad | ||
|
|
3261995092 | ||
|
|
24be46323b | ||
|
|
c17a17e44b | ||
|
|
c0a5905522 | ||
|
|
920de2cbe8 | ||
|
|
941c1a5fa8 | ||
|
|
4bae11b533 | ||
|
|
68128efa4b | ||
|
|
08b6fe9ef1 | ||
|
|
6dfc7cbe61 | ||
|
|
ec7ba48e67 | ||
|
|
83dda66aac | ||
|
|
23e4af185a | ||
|
|
8b6919c77c | ||
|
|
0d2a2b98c9 | ||
|
|
225af964c0 | ||
|
|
f977a9f2be | ||
|
|
73c2e9153a | ||
|
|
c6a26cb39d | ||
|
|
97f8c78b09 | ||
|
|
ed1967c706 | ||
|
|
e22759b1e5 | ||
|
|
0a331f49c1 | ||
|
|
213725057e | ||
|
|
24f8a68d0a | ||
|
|
c538a2eb12 | ||
|
|
2e8cd42974 | ||
|
|
78389b29f9 | ||
|
|
cf7d8eabcc | ||
|
|
29a4e710de | ||
|
|
bdfe457a2c | ||
|
|
7b18981830 | ||
|
|
dec83ea4ac | ||
|
|
1c0fa36c61 | ||
|
|
66d3095993 | ||
|
|
82d347a477 | ||
|
|
f6e9ed76ae | ||
|
|
94742054a8 | ||
|
|
0c01fca444 | ||
|
|
a331ae4630 | ||
|
|
8f9ab04d93 | ||
|
|
abbc82f448 | ||
|
|
35a68c276d | ||
|
|
e08bef442c | ||
|
|
dbf7d525a5 | ||
|
|
1d94cd4bfa | ||
|
|
c4664d1731 | ||
|
|
3664345aba | ||
|
|
8309988111 | ||
|
|
423a057023 | ||
|
|
edd16831b1 | ||
|
|
a620b79040 | ||
|
|
4137956d0e | ||
|
|
1db720cd6d | ||
|
|
7667f8efc6 | ||
|
|
40a94597ae | ||
|
|
c0dd221a3a | ||
|
|
d0be36cf5b | ||
|
|
5b6269a253 | ||
|
|
a54300b3f6 | ||
|
|
3ea76a768c | ||
|
|
a8722f5330 | ||
|
|
b3d28d14d6 | ||
|
|
5ff77b005b | ||
|
|
adc4265792 | ||
|
|
3a71fa36a2 | ||
|
|
371c016986 | ||
|
|
68ab716f18 | ||
|
|
0421404b73 | ||
|
|
d05070c98d | ||
|
|
b5aca81de1 | ||
|
|
3ae88e023c | ||
|
|
c2062ca470 | ||
|
|
7062465be0 | ||
|
|
f2940b7120 | ||
|
|
c741faf4bb | ||
|
|
701a5f9de9 | ||
|
|
b17e2b8214 | ||
|
|
27d6cf4860 | ||
|
|
e6d8bad618 | ||
|
|
1ebf6fba42 | ||
|
|
b582aa9a44 | ||
|
|
bb16a6b2c2 | ||
|
|
f0b329df50 | ||
|
|
7bcf62a05b | ||
|
|
0d68d0a69b | ||
|
|
e06da17931 | ||
|
|
e7c7788e20 | ||
|
|
4d8db154ad | ||
|
|
bc3e88b9af | ||
|
|
5e1bb07701 | ||
|
|
bf9fb65001 | ||
|
|
ac54df17df | ||
|
|
a8d001aedf | ||
|
|
60d5cdf137 | ||
|
|
fb2314798e | ||
|
|
f2b12424c0 | ||
|
|
1eef4f2a0c | ||
|
|
a8cb1d2b85 | ||
|
|
3d1ec33f96 | ||
|
|
d078c59ed9 | ||
|
|
fc444fbc70 | ||
|
|
979020fcad | ||
|
|
ffdc2c4123 | ||
|
|
cc13d8696f | ||
|
|
3550cc5fd9 | ||
|
|
c90cd09331 | ||
|
|
c892127f76 | ||
|
|
5e3f0f5671 | ||
|
|
4d034b1a1e | ||
|
|
bb3a81c4b4 | ||
|
|
464667153d | ||
|
|
9bf95d8291 | ||
|
|
e6d16c0956 | ||
|
|
4266f5b1c4 | ||
|
|
f4319a4f73 | ||
|
|
e46e208819 | ||
|
|
a41aa46759 | ||
|
|
13fc7f20a4 | ||
|
|
63761ab91e | ||
|
|
9ef0c39b2b | ||
|
|
af23980de7 | ||
|
|
57ba83d4e0 | ||
|
|
928fdbea08 | ||
|
|
a1c28567c6 | ||
|
|
067340bbc8 | ||
|
|
f001c63073 | ||
|
|
b64f149176 | ||
|
|
2c386b55f2 | ||
|
|
d33f4c6eb8 | ||
|
|
10b15f0f8b | ||
|
|
ae90010891 | ||
|
|
5446377c6b | ||
|
|
ee864f3301 | ||
|
|
a79f332333 | ||
|
|
959cecf046 | ||
|
|
583af4979b | ||
|
|
f51b73c833 | ||
|
|
421d309908 | ||
|
|
e6ea244004 | ||
|
|
b86529f751 | ||
|
|
dddbe0fc33 | ||
|
|
cb3833a3be | ||
|
|
1482ed2d56 | ||
|
|
fd4641696c |
No files matched your search
+1
-1
@@ -39,5 +39,5 @@ before_script:
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
|
||||
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
|
||||
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg
|
||||
@@ -1,21 +1,208 @@
|
||||
PHP NEWS
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? Feb 2015, PHP 5.6.6
|
||||
16 Apr 2015, PHP 5.6.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #66609 (php crashes with __get() and ++ operator in some cases).
|
||||
(Dmitry, Laruence)
|
||||
. Fixed bug #68021 (get_browser() browser_name_regex returns non-utf-8
|
||||
characters). (Tjerk)
|
||||
. Fixed bug #68917 (parse_url fails on some partial urls). (Wei Dai)
|
||||
. Fixed bug #69134 (Per Directory Values overrides PHP_INI_SYSTEM
|
||||
configuration options). (Anatol Belski)
|
||||
. Additional fix for bug #69152 (Type confusion vulnerability in
|
||||
exception::getTraceAsString). (Stas)
|
||||
. Fixed bug #69210 (serialize function return corrupted data when sleep has
|
||||
non-string values). (Juan Basso)
|
||||
. Fixed bug #69212 (Leaking VIA_HANDLER func when exception thrown in
|
||||
__call/... arg passing). (Nikita)
|
||||
. Fixed bug #69221 (Segmentation fault when using a generator in combination
|
||||
with an Iterator). (Nikita)
|
||||
. Fixed bug #69337 (php_stream_url_wrap_http_ex() type-confusion
|
||||
vulnerability). (Stas)
|
||||
. Fixed bug #69353 (Missing null byte checks for paths in various PHP
|
||||
extensions). (Stas)
|
||||
|
||||
- Apache2handler:
|
||||
. Fixed bug #69218 (potential remote code execution with apache 2.4
|
||||
apache2handler). (Gerrit Venema)
|
||||
|
||||
- cURL:
|
||||
. Implemented FR#69278 (HTTP2 support). (Masaki Kagaya)
|
||||
. Fixed bug #68739 (Missing break / control flow). (Laruence)
|
||||
. Fixed bug #69316 (Use-after-free in php_curl related to
|
||||
CURLOPT_FILE/_INFILE/_WRITEHEADER). (Laruence)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #69336 (Issues with "last day of <monthname>"). (Derick Rethans)
|
||||
|
||||
- Enchant:
|
||||
. Fixed bug #65406 (Enchant broker plugins are in the wrong place in windows
|
||||
builds). (Anatol)
|
||||
|
||||
- Ereg:
|
||||
. Fixed bug #68740 (NULL Pointer Dereference). (Laruence)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #68819 (Fileinfo on specific file causes spurious OOM and/or
|
||||
segfault). (Anatol Belski)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #69202: (FILTER_FLAG_STRIP_BACKTICK ignored unless other
|
||||
flags are used). (Jeff Welch)
|
||||
. Fixed bug #69203 (FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127). (Jeff
|
||||
Welch)
|
||||
|
||||
- OPCache:
|
||||
. Fixed bug #69297 (function_exists strange behavior with OPCache on
|
||||
disabled function). (Laruence)
|
||||
. Fixed bug #69281 (opcache_is_script_cached no longer works). (danack)
|
||||
. Fixed bug #68677 (Use After Free). (CVE-2015-1351) (Laruence)
|
||||
|
||||
- OpenSSL
|
||||
. Fixed bugs #68853, #65137 (Buffered crypto stream data breaks IO polling
|
||||
in stream_select() contexts) (Chris Wright)
|
||||
. Fixed bug #69197 (openssl_pkcs7_sign handles default value incorrectly)
|
||||
(Daniel Lowrey)
|
||||
. Fixed bug #69215 (Crypto servers should send client CA list)
|
||||
(Daniel Lowrey)
|
||||
. Add a check for RAND_egd to allow compiling against LibreSSL (Leigh)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #64343 (PharData::extractTo fails for tarball created by BSD tar).
|
||||
(Mike)
|
||||
. Fixed bug #64931 (phar_add_file is too restrictive on filename). (Mike)
|
||||
. Fixed bug #65467 (Call to undefined method cli_arg_typ_string). (Mike)
|
||||
. Fixed bug #67761 (Phar::mapPhar fails for Phars inside a path containing
|
||||
".tar"). (Mike)
|
||||
. Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar). (Stas)
|
||||
. Fixed bug #69441 (Buffer Overflow when parsing tar/zip/phar in
|
||||
phar_set_inode). (Stas)
|
||||
|
||||
- Postgres:
|
||||
. Fixed bug #68741 (Null pointer dereference). (CVE-2015-1352) (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #69227 (Use after free in zval_scan caused by
|
||||
spl_object_storage_get_gc). (adam dot scarr at 99designs dot com)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #69293 (NEW segfault when using SoapClient::__setSoapHeader
|
||||
(bisected, regression)). (Laruence)
|
||||
|
||||
- Sqlite3:
|
||||
. Fixed bug #68760 (SQLITE segfaults if custom collator throws an exception).
|
||||
(Dan Ackroyd)
|
||||
. Fixed bug #69287 (Upgrade bundled libsqlite to 3.8.8.3). (Anatol)
|
||||
. Fixed bug #66550 (SQLite prepared statement use-after-free). (Sean Heelan)
|
||||
|
||||
19 Mar 2015, PHP 5.6.7
|
||||
|
||||
- Core:
|
||||
. Fixed bug #69174 (leaks when unused inner class use traits precedence).
|
||||
(Laruence)
|
||||
. Fixed bug #69139 (Crash in gc_zval_possible_root on unserialize).
|
||||
(Laruence)
|
||||
. Fixed bug #69121 (Segfault in get_current_user when script owner is not
|
||||
in passwd with ZTS build). (dan at syneto dot net)
|
||||
. Fixed bug #65593 (Segfault when calling ob_start from output buffering
|
||||
callback). (Mike)
|
||||
. Fixed bug #68986 (pointer returned by php_stream_fopen_temporary_file
|
||||
not validated in memory.c). (nayana at ddproperty dot com)
|
||||
. Fixed bug #68166 (Exception with invalid character causes segv). (Rasmus)
|
||||
. Fixed bug #69141 (Missing arguments in reflection info for some builtin
|
||||
functions). (kostyantyn dot lysyy at oracle dot com)
|
||||
. Fixed bug #68976 (Use After Free Vulnerability in unserialize()).
|
||||
(CVE-2015-2787) (Stas)
|
||||
. Fixed bug #69134 (Per Directory Values overrides PHP_INI_SYSTEM
|
||||
configuration options). (Anatol Belski)
|
||||
. Fixed bug #69207 (move_uploaded_file allows nulls in path). (CVE-2015-2348)
|
||||
(Stas)
|
||||
|
||||
- CGI:
|
||||
. Fixed bug #69015 (php-cgi's getopt does not see $argv). (Laruence)
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #67741 (auto_prepend_file messes up __LINE__). (Reeze Xia)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #69088 (PHP_MINIT_FUNCTION does not fully initialize cURL on
|
||||
Win32). (Grant Pannell)
|
||||
. Add CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5_HOSTNAME constants if supported
|
||||
by libcurl. (Linus Unneback)
|
||||
|
||||
- Ereg:
|
||||
. Fixed bug #69248 (heap overflow vulnerability in regcomp.c). (CVE-2015-2305)
|
||||
(Stas)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #68822 (request time is reset too early). (honghu069 at 163 dot com)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #68964 (Allowed memory size exhausted with odbc_exec). (Anatol)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #69159 (Opcache causes problem when passing a variable variable
|
||||
to a function). (Dmitry, Laruence)
|
||||
. Fixed bug #69125 (Array numeric string as key). (Laruence)
|
||||
. Fixed bug #69038 (switch(SOMECONSTANT) misbehaves). (Laruence)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #68912 (Segmentation fault at openssl_spki_new). (Laruence)
|
||||
. Fixed bug #61285, #68329, #68046, #41631 (encrypted streams don't observe
|
||||
socket timeouts). (Brad Broerman)
|
||||
. Fixed bug #68920 (use strict peer_fingerprint input checks)
|
||||
(Daniel Lowrey)
|
||||
. Fixed bug #68879 (IP Address fields in subjectAltNames not used)
|
||||
(Daniel Lowrey)
|
||||
. Fixed bug #68265 (SAN match fails with trailing DNS dot) (Daniel Lowrey)
|
||||
. Fixed bug #67403 (Add signatureType to openssl_x509_parse) (Daniel Lowrey)
|
||||
. Fixed bug (#69195 Inconsistent stream crypto values across versions)
|
||||
(Daniel Lowrey)
|
||||
|
||||
- pgsql:
|
||||
. Fixed bug #68638 (pg_update() fails to store infinite values).
|
||||
(william dot welter at 4linux dot com dot br, Laruence)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #69054 (Null dereference in readline_(read|write)_history() without
|
||||
parameters). (Laruence)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #69085 (SoapClient's __call() type confusion through
|
||||
unserialize()). (andrea dot palazzo at truel dot it, Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #69108 ("Segmentation fault" when (de)serializing
|
||||
SplObjectStorage). (Laruence)
|
||||
. Fixed bug #68557 (RecursiveDirectoryIterator::seek(0) broken after
|
||||
calling getChildren()). (Julien)
|
||||
|
||||
- ZIP:
|
||||
. Fixed bug #69253 (ZIP Integer Overflow leads to writing past heap
|
||||
boundary). (CVE-2015-2331) (Stas)
|
||||
|
||||
19 Feb 2015, PHP 5.6.6
|
||||
|
||||
- Core:
|
||||
. Removed support for multi-line headers, as the are deprecated by RFC 7230.
|
||||
(Stas)
|
||||
. Fixed bug #67068 (getClosure returns somethings that's not a closure).
|
||||
(Danack at basereality dot com)
|
||||
. Fixed bug #68942 (Use after free vulnerability in unserialize() with
|
||||
DateTimeZone). (CVE-2015-0273) (Stas)
|
||||
. Fixed bug #68925 (Mitigation for CVE-2015-0235 – GHOST: glibc gethostbyname
|
||||
buffer overflow). (Stas)
|
||||
. Fixed Bug #67988 (htmlspecialchars() does not respect default_charset
|
||||
specified by ini_set) (Yasuo)
|
||||
. Added NULL byte protection to exec, system and passthru. (Yasuo)
|
||||
|
||||
- Dba:
|
||||
. Fixed bug #68711 (useless comparisons). (bugreports at internot dot info)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #50224 (json_encode() does not always encode a float as a float)
|
||||
by adding JSON_PRESERVE_ZERO_FRACTION. (Juan Basso)
|
||||
- Enchant:
|
||||
. Fixed bug #68552 (heap buffer overflow in enchant_broker_request_dict()).
|
||||
(CVE-2014-9705) (Antony)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #68827 (Double free with disabled ZMM). (Joshua Rogers)
|
||||
@@ -30,23 +217,30 @@
|
||||
(redfoxli069 at gmail dot com, Laruence)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #68938 (json_decode() decodes empty string without error).
|
||||
(jeremy at bat-country dot us)
|
||||
. Fixed bug #50224 (json_encode() does not always encode a float as a float)
|
||||
by adding JSON_PRESERVE_ZERO_FRACTION. (Juan Basso)
|
||||
|
||||
- LIBXML:
|
||||
. Fixed bug #64938 (libxml_disable_entity_loader setting is shared
|
||||
between threads). (Martin Jansen)
|
||||
|
||||
- Mysqli:
|
||||
. Fixed bug #68114 (linker error on some OS X machines with fixed
|
||||
width decimal support) (Keyur Govande)
|
||||
. Fixed bug #68657 (Reading 4 byte floats with Mysqli and libmysqlclient
|
||||
has rounding errors) (Keyur Govande)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug with try blocks being removed when extended_info opcode
|
||||
generation is turned on. (Laruence)
|
||||
|
||||
- PDO_mysql:
|
||||
. Fixed bug #68750 (PDOMysql with mysqlnd does not allow the usage of
|
||||
named pipes). (steffenb198@aol.com)
|
||||
named pipes). (steffenb198 at aol dot com)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #68901 (use after free). (bugreports at internot dot info)
|
||||
. Fixed bug #68901 (use after free). (CVE-2015-2301)
|
||||
(bugreports at internot dot info)
|
||||
|
||||
- Pgsql:
|
||||
. Fixed Bug #65199 (pg_copy_from() modifies input array variable) (Yasuo)
|
||||
@@ -63,12 +257,8 @@
|
||||
- Standard:
|
||||
. Fixed bug #65272 (flock() out parameter not set correctly in windows).
|
||||
(Daniel Lowrey)
|
||||
|
||||
- Mysqli:
|
||||
. Fixed bug #68114 (linker error on some OS X machines with fixed
|
||||
width decimal support) (Keyur Govande)
|
||||
. Fixed bug #68657 (Reading 4 byte floats with Mysqli and libmysqlclient
|
||||
has rounding errors) (Keyur Govande)
|
||||
. Fixed bug #69033 (Request may get env. variables from previous requests
|
||||
if PHP works as FastCGI). (Anatol)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug which caused call after final close on streams filter. (Bob)
|
||||
@@ -90,7 +280,7 @@
|
||||
. Fixed bug #68583 (Crash in timeout thread). (Anatol)
|
||||
. Fixed bug #65576 (Constructor from trait conflicts with inherited
|
||||
constructor). (dunglas at gmail dot com)
|
||||
. Fixed bug #68676 (Explicit Double Free). (Kalle)
|
||||
. Fixed bug #68676 (Explicit Double Free). (CVE-2014-9425) (Kalle)
|
||||
. Fixed bug #68710 (Use After Free Vulnerability in PHP's unserialize()).
|
||||
(CVE-2015-0231) (Stefan Esser)
|
||||
|
||||
@@ -110,7 +300,7 @@
|
||||
interval). (Marc Bennewitz)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #68799: Free called on unitialized pointer. (CVE-2015-0232)
|
||||
. Fixed bug #68799: Free called on uninitialized pointer. (CVE-2015-0232)
|
||||
(Stas)
|
||||
|
||||
- Fileinfo:
|
||||
@@ -120,7 +310,7 @@
|
||||
(Joshua Rogers, Anatol Belski)
|
||||
. Removed readelf.c and related code from libmagic sources
|
||||
(Remi, Anatol)
|
||||
. Fixed bug #68735 (fileinfo out-of-bounds memory access).
|
||||
. Fixed bug #68735 (fileinfo out-of-bounds memory access). (CVE-2014-9652)
|
||||
(Anatol)
|
||||
|
||||
- FPM:
|
||||
@@ -128,7 +318,8 @@
|
||||
. Fixed bug #68751 (listen.allowed_clients is broken). (Remi)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #68601 (buffer read overflow in gd_gif_in.c). (Jan Bee, Remi)
|
||||
. Fixed bug #68601 (buffer read overflow in gd_gif_in.c). (CVE-2014-9709)
|
||||
(Jan Bee, Remi)
|
||||
. Fixed request #68656 (Report gd library version). (Remi)
|
||||
|
||||
- mbstring:
|
||||
@@ -301,6 +492,9 @@
|
||||
(Matteo, Alain Laporte)
|
||||
. Fixed bug #66584 (Segmentation fault on statement deallocation) (Matteo)
|
||||
|
||||
- OpenSSL:
|
||||
. Revert regression introduced by fix of bug #41631
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi)
|
||||
|
||||
@@ -567,7 +761,7 @@
|
||||
. Fixed bug #67606 (revised fix 67541, broke mod_fastcgi BC). (David Zuelke)
|
||||
. Fixed bug #67530 (error_log=syslog ignored). (Remi)
|
||||
. Fixed bug #67635 (php links to systemd libraries without using pkg-config).
|
||||
(pacho@gentoo.org, Remi)
|
||||
(pacho at gentoo dot org, Remi)
|
||||
. Fixed bug #67531 (syslog cannot be set in pool configuration). (Remi)
|
||||
. Fixed bug #67541 (Fix Apache 2.4.10+ SetHandler proxy:fcgi://
|
||||
incompatibilities). (David Zuelke)
|
||||
@@ -969,7 +1163,7 @@
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #67635 (php links to systemd libraries without using pkg-config).
|
||||
(pacho@gentoo.org, Remi)
|
||||
(pacho at gentoo dot org, Remi)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #66901 (php-gd 'c_color' NULL pointer dereference).
|
||||
|
||||
@@ -394,6 +394,9 @@ PHP 5.6 UPGRADE NOTES
|
||||
10. New Global Constants
|
||||
========================================
|
||||
|
||||
- CURL:
|
||||
CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 (>= 5.6.8)
|
||||
|
||||
- LDAP:
|
||||
LDAP_ESCAPE_FILTER int(1)
|
||||
LDAP_ESCAPE_DN int(2)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #66609 (php crashes with __get() and ++ operator in some cases)
|
||||
--FILE--
|
||||
<?php
|
||||
$bar = new Bar;
|
||||
$foo = new Foo;
|
||||
class Bar {
|
||||
public function __get($x) {
|
||||
global $foo;
|
||||
return $foo->foo;
|
||||
}
|
||||
}
|
||||
class Foo {
|
||||
public function __get($x) {
|
||||
global $bar;
|
||||
return $bar->bar;
|
||||
}
|
||||
}
|
||||
$foo->blah += 1; //crash
|
||||
++$foo->blah; //crash
|
||||
$foo->blah++; //crash
|
||||
$foo->blah--; //crash
|
||||
--$foo->blah; //crash
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: Bar::$bar in %sbug66609.php on line %d
|
||||
okey
|
||||
@@ -2,14 +2,14 @@
|
||||
bug67436: Autoloader isn't called if user defined error handler is present
|
||||
|
||||
--INI--
|
||||
error_reporting=
|
||||
error_reporting=-1
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once ($classname . '.php');
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ error_reporting=-1
|
||||
|
||||
spl_autoload_register(function($classname) {
|
||||
if (in_array($classname, array('a','b','c'))) {
|
||||
require_once ($classname . '.php');
|
||||
require_once __DIR__ . "/{$classname}.php";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
#69017 (Fail to push to the empty array with the constant value defined in class scope)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class c1
|
||||
{
|
||||
const ZERO = 0;
|
||||
const ONE = 1;
|
||||
const MAX = PHP_INT_MAX;
|
||||
public static $a1 = array(self::ONE => 'one');
|
||||
public static $a2 = array(self::ZERO => 'zero');
|
||||
public static $a3 = array(self::MAX => 'zero');
|
||||
}
|
||||
|
||||
|
||||
c1::$a1[] = 1;
|
||||
c1::$a2[] = 1;
|
||||
c1::$a3[] = 1;
|
||||
|
||||
var_dump(c1::$a1);
|
||||
var_dump(c1::$a2);
|
||||
var_dump(c1::$a3);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot add element to the array as the next element is already occupied in %sbug69017.php on line %d
|
||||
array(2) {
|
||||
[1]=>
|
||||
string(3) "one"
|
||||
[2]=>
|
||||
int(1)
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(4) "zero"
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
array(1) {
|
||||
[%d]=>
|
||||
string(4) "zero"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #69174 (leaks when unused inner class use traits precedence)
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
class C1 {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof T2;
|
||||
T1::bar insteadof T2;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #69212: Leaking VIA_HANDLER func when exception thrown in __call/... arg passing
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public static function __callStatic($method, $args) {}
|
||||
public function __call($method, $args) {}
|
||||
}
|
||||
|
||||
function do_throw() { throw new Exception; }
|
||||
|
||||
try {
|
||||
Test::foo(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
try {
|
||||
(new Test)->bar(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$f = function () {};
|
||||
$f->__invoke(do_throw());
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$t = new Test;
|
||||
$f->__invoke($t->bar(Test::foo(do_throw())));
|
||||
} catch (Exception $e) {
|
||||
echo "Caught!\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
Caught!
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$gen1 = gen();
|
||||
$gen2 = (object) $gen1;
|
||||
|
||||
foreach ($gen1 as $v1) {
|
||||
foreach ($gen2 as $v2) {
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
|
||||
unset($gen1);
|
||||
foreach ($gen2 as $v) { var_dump($v); }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #69221: Segmentation fault when using a generator in combination with an Iterator (2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$gen = function() {
|
||||
yield 1;
|
||||
};
|
||||
|
||||
$iter = new IteratorIterator($gen());
|
||||
$ngen = $iter->getInnerIterator();
|
||||
|
||||
var_dump(iterator_to_array($ngen, false));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
+21
-2
@@ -4211,6 +4211,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait
|
||||
static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
size_t i, j = 0;
|
||||
zend_trait_precedence **precedences;
|
||||
zend_trait_precedence *cur_precedence;
|
||||
zend_trait_method_reference *cur_method_ref;
|
||||
char *lcname;
|
||||
@@ -4219,7 +4220,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
/* resolve class references */
|
||||
if (ce->trait_precedences) {
|
||||
i = 0;
|
||||
while ((cur_precedence = ce->trait_precedences[i])) {
|
||||
precedences = ce->trait_precedences;
|
||||
ce->trait_precedences = NULL;
|
||||
while ((cur_precedence = precedences[i])) {
|
||||
/** Resolve classes for all precedence operations. */
|
||||
if (cur_precedence->exclude_from_classes) {
|
||||
cur_method_ref = cur_precedence->trait_method;
|
||||
@@ -4276,6 +4279,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
|
||||
}
|
||||
i++;
|
||||
}
|
||||
ce->trait_precedences = precedences;
|
||||
}
|
||||
|
||||
if (ce->trait_aliases) {
|
||||
@@ -4343,16 +4347,20 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
|
||||
for (i = 0; i < ce->num_traits; i++) {
|
||||
if (ce->trait_precedences) {
|
||||
HashTable exclude_table;
|
||||
zend_trait_precedence **precedences;
|
||||
|
||||
/* TODO: revisit this start size, may be its not optimal */
|
||||
zend_hash_init_ex(&exclude_table, 2, NULL, NULL, 0, 0);
|
||||
|
||||
zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]);
|
||||
precedences = ce->trait_precedences;
|
||||
ce->trait_precedences = NULL;
|
||||
zend_traits_compile_exclude_table(&exclude_table, precedences, ce->traits[i]);
|
||||
|
||||
/* copies functions, applies defined aliasing, and excludes unused trait methods */
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, &exclude_table);
|
||||
|
||||
zend_hash_destroy(&exclude_table);
|
||||
ce->trait_precedences = precedences;
|
||||
} else {
|
||||
zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, NULL);
|
||||
}
|
||||
@@ -4360,6 +4368,17 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
|
||||
|
||||
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t)zend_fixup_trait_method, ce TSRMLS_CC);
|
||||
|
||||
if (ce->trait_precedences) {
|
||||
i = 0;
|
||||
while (ce->trait_precedences[i]) {
|
||||
if (ce->trait_precedences[i]->exclude_from_classes) {
|
||||
efree(ce->trait_precedences[i]->exclude_from_classes);
|
||||
ce->trait_precedences[i]->exclude_from_classes = NULL;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (overriden) {
|
||||
zend_hash_destroy(overriden);
|
||||
FREE_HASHTABLE(overriden);
|
||||
|
||||
@@ -587,10 +587,14 @@ ZEND_METHOD(exception, getTraceAsString)
|
||||
|
||||
DEFAULT_0_PARAMS;
|
||||
|
||||
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
|
||||
if(Z_TYPE_P(trace) != IS_ARRAY) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
res = estrdup("");
|
||||
str = &res;
|
||||
|
||||
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
|
||||
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace) TSRMLS_CC, (apply_func_args_t)_build_trace_string, 3, str, len, &num);
|
||||
|
||||
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
|
||||
|
||||
@@ -605,9 +605,9 @@ ZEND_METHOD(Generator, __wakeup)
|
||||
|
||||
static void zend_generator_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zval *object = ((zend_generator_iterator *) iterator)->object;
|
||||
zend_generator_iterator *iter = (zend_generator_iterator *) iterator;
|
||||
|
||||
zval_ptr_dtor(&object);
|
||||
zend_objects_store_del_ref_by_handle(iter->handle TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -699,8 +699,8 @@ zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *ob
|
||||
|
||||
/* We have to keep a reference to the generator object zval around,
|
||||
* otherwise the generator may be destroyed during iteration. */
|
||||
Z_ADDREF_P(object);
|
||||
iterator->object = object;
|
||||
iterator->handle = Z_OBJ_HANDLE_P(object);
|
||||
zend_objects_store_add_ref_by_handle(iterator->handle TSRMLS_CC);
|
||||
|
||||
return (zend_object_iterator *) iterator;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ extern ZEND_API zend_class_entry *zend_ce_generator;
|
||||
typedef struct _zend_generator_iterator {
|
||||
zend_object_iterator intern;
|
||||
|
||||
/* The generator object zval has to be stored, because the iterator is
|
||||
* holding a ref to it, which has to be dtored. */
|
||||
zval *object;
|
||||
/* The generator object handle has to be stored, because the
|
||||
* iterator is holding a ref to it, which has to be dtored. */
|
||||
zend_object_handle handle;
|
||||
} zend_generator_iterator;
|
||||
|
||||
typedef struct _zend_generator {
|
||||
|
||||
@@ -1269,6 +1269,9 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
|
||||
if (key_type == HASH_KEY_IS_LONG) {
|
||||
p->h = num_index;
|
||||
if ((long)num_index >= (long)ht->nNextFreeElement) {
|
||||
ht->nNextFreeElement = num_index < LONG_MAX ? num_index + 1 : LONG_MAX;
|
||||
}
|
||||
} else {
|
||||
p->h = h;
|
||||
p->nKeyLength = str_length;
|
||||
|
||||
+6
-1
@@ -256,9 +256,14 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce)
|
||||
efree(ce->trait_precedences[i]->trait_method);
|
||||
|
||||
if (ce->trait_precedences[i]->exclude_from_classes) {
|
||||
zend_uint j = 0;
|
||||
zend_trait_precedence *cur_precedence = ce->trait_precedences[i];
|
||||
while (cur_precedence->exclude_from_classes[j]) {
|
||||
efree(cur_precedence->exclude_from_classes[j]);
|
||||
j++;
|
||||
}
|
||||
efree(ce->trait_precedences[i]->exclude_from_classes);
|
||||
}
|
||||
|
||||
efree(ce->trait_precedences[i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
+15
-3
@@ -378,6 +378,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -418,6 +419,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (IS_OP2_TMP_FREE()) {
|
||||
@@ -636,7 +638,10 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -653,6 +658,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -737,9 +743,10 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -758,6 +765,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -5247,6 +5255,10 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
}
|
||||
zval_ptr_dtor(&call->object);
|
||||
}
|
||||
if (call->fbc->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
|
||||
efree((char *) call->fbc->common.function_name);
|
||||
efree(call->fbc);
|
||||
}
|
||||
call--;
|
||||
} while (call >= EX(call_slots));
|
||||
EX(call) = NULL;
|
||||
|
||||
+142
-36
@@ -1214,6 +1214,10 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
|
||||
}
|
||||
zval_ptr_dtor(&call->object);
|
||||
}
|
||||
if (call->fbc->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
|
||||
efree((char *) call->fbc->common.function_name);
|
||||
efree(call->fbc);
|
||||
}
|
||||
call--;
|
||||
} while (call >= EX(call_slots));
|
||||
EX(call) = NULL;
|
||||
@@ -14548,6 +14552,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -14588,6 +14593,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -14805,7 +14811,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -14822,6 +14831,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -14906,9 +14916,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -14927,6 +14938,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -17051,6 +17063,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -17091,6 +17104,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (1) {
|
||||
@@ -17309,7 +17323,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -17326,6 +17343,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -17410,9 +17428,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -17431,6 +17450,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -19141,6 +19161,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -19181,6 +19202,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -19399,7 +19421,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -19416,6 +19441,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -19500,9 +19526,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -19521,6 +19548,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -21336,6 +21364,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -21376,6 +21405,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -22764,6 +22794,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -22804,6 +22835,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -23021,7 +23053,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -23038,6 +23073,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -23122,9 +23158,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -23143,6 +23180,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -24715,6 +24753,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -24755,6 +24794,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -24971,7 +25011,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -24988,6 +25031,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -25072,9 +25116,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -25093,6 +25138,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -26120,6 +26166,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -26160,6 +26207,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (1) {
|
||||
@@ -26377,7 +26425,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -26394,6 +26445,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -26478,9 +26530,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -26499,6 +26552,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -27434,6 +27488,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -27474,6 +27529,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -27691,7 +27747,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -27708,6 +27767,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -27792,9 +27852,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -27813,6 +27874,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -28749,6 +28811,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -28789,6 +28852,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -29178,6 +29242,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -29218,6 +29283,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -29434,7 +29500,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -29451,6 +29520,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -29535,9 +29605,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -29556,6 +29627,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -32005,6 +32077,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -32045,6 +32118,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -32261,7 +32335,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -32278,6 +32355,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -32362,9 +32440,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -32383,6 +32462,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -34277,6 +34357,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -34317,6 +34398,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (1) {
|
||||
@@ -34534,7 +34616,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -34551,6 +34636,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -34635,9 +34721,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -34656,6 +34743,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -36228,6 +36316,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -36268,6 +36357,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -36485,7 +36575,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -36502,6 +36595,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -36586,9 +36680,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -36607,6 +36702,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -38283,6 +38379,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -38323,6 +38420,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -39562,6 +39660,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
|
||||
if (!have_get_ptr) {
|
||||
zval *z = NULL;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
if (opline->extended_value == ZEND_ASSIGN_OBJ) {
|
||||
if (Z_OBJ_HT_P(object)->read_property) {
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
@@ -39602,6 +39701,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
|
||||
EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval);
|
||||
}
|
||||
}
|
||||
zval_ptr_dtor(&object);
|
||||
}
|
||||
|
||||
if (0) {
|
||||
@@ -39818,7 +39918,10 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -39835,6 +39938,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
|
||||
incdec_op(z);
|
||||
*retval = z;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, opline);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
@@ -39919,9 +40023,10 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
|
||||
|
||||
if (!have_get_ptr) {
|
||||
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval *z_copy;
|
||||
zval *z, *z_copy;
|
||||
|
||||
Z_ADDREF_P(object);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
@@ -39940,6 +40045,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
|
||||
incdec_op(z_copy);
|
||||
Z_ADDREF_P(z);
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z_copy, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
zval_ptr_dtor(&z_copy);
|
||||
zval_ptr_dtor(&z);
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=6
|
||||
PHP_RELEASE_VERSION=6
|
||||
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`
|
||||
|
||||
|
||||
+18
-1
@@ -837,6 +837,11 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4);
|
||||
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5);
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071200 /* Available since 7.18.0 */
|
||||
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS4A);
|
||||
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5_HOSTNAME);
|
||||
#endif
|
||||
|
||||
/* Curl Share constants */
|
||||
REGISTER_CURL_CONSTANT(CURLSHOPT_NONE);
|
||||
REGISTER_CURL_CONSTANT(CURLSHOPT_SHARE);
|
||||
@@ -845,6 +850,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
/* Curl Http Version constants (CURLOPT_HTTP_VERSION) */
|
||||
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_0);
|
||||
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_1_1);
|
||||
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
|
||||
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2_0);
|
||||
#endif
|
||||
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_NONE);
|
||||
|
||||
/* Curl Lock constants */
|
||||
@@ -874,6 +882,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURL_VERSION_KERBEROS4);
|
||||
REGISTER_CURL_CONSTANT(CURL_VERSION_LIBZ);
|
||||
REGISTER_CURL_CONSTANT(CURL_VERSION_SSL);
|
||||
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
|
||||
REGISTER_CURL_CONSTANT(CURL_VERSION_HTTP2);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x070a06 /* Available since 7.10.6 */
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
|
||||
@@ -1232,7 +1243,7 @@ PHP_MINIT_FUNCTION(curl)
|
||||
gcry_control(GCRYCTL_SET_THREAD_CBS, &php_curl_gnutls_tsl);
|
||||
#endif
|
||||
|
||||
if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) {
|
||||
if (curl_global_init(CURL_GLOBAL_DEFAULT) != CURLE_OK) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -1335,6 +1346,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
|
||||
length = -1;
|
||||
} else if (retval_ptr) {
|
||||
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
|
||||
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
|
||||
convert_to_long_ex(&retval_ptr);
|
||||
}
|
||||
@@ -1400,6 +1412,7 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
|
||||
if (error == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
|
||||
} else if (retval_ptr) {
|
||||
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
|
||||
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
|
||||
convert_to_long_ex(&retval_ptr);
|
||||
}
|
||||
@@ -1478,6 +1491,7 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
||||
if (error == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
|
||||
} else if (retval_ptr) {
|
||||
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
|
||||
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
|
||||
convert_to_long_ex(&retval_ptr);
|
||||
}
|
||||
@@ -1555,6 +1569,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
length = CURL_READFUNC_ABORT;
|
||||
#endif
|
||||
} else if (retval_ptr) {
|
||||
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
|
||||
if (Z_TYPE_P(retval_ptr) == IS_STRING) {
|
||||
length = MIN((int) (size * nmemb), Z_STRLEN_P(retval_ptr));
|
||||
memcpy(data, Z_STRVAL_P(retval_ptr), length);
|
||||
@@ -1629,6 +1644,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
|
||||
length = -1;
|
||||
} else if (retval_ptr) {
|
||||
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
|
||||
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
|
||||
convert_to_long_ex(&retval_ptr);
|
||||
}
|
||||
@@ -2836,6 +2852,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC)
|
||||
curl_easy_setopt(ch->cp, CURLOPT_SHARE, sh->share);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */
|
||||
case CURLOPT_FNMATCH_FUNCTION:
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function hdr_callback($ch, $data) {
|
||||
// close the stream, causing the FILE structure to be free()'d
|
||||
if($GLOBALS['f_file']) {
|
||||
fclose($GLOBALS['f_file']); $GLOBALS['f_file'] = 0;
|
||||
|
||||
// cause an allocation of approx the same size as a FILE structure, size varies a bit depending on platform/libc
|
||||
$FILE_size = (PHP_INT_SIZE == 4 ? 0x160 : 0x238);
|
||||
curl_setopt($ch, CURLOPT_COOKIE, str_repeat("a", $FILE_size - 1));
|
||||
}
|
||||
return strlen($data);
|
||||
}
|
||||
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
$temp_file = dirname(__FILE__) . '/body.tmp';
|
||||
$url = "{$host}/get.php?test=getpost";
|
||||
$ch = curl_init();
|
||||
$f_file = fopen($temp_file, "w") or die("failed to open file\n");
|
||||
curl_setopt($ch, CURLOPT_BUFFERSIZE, 10);
|
||||
curl_setopt($ch, CURLOPT_HEADERFUNCTION, "hdr_callback");
|
||||
curl_setopt($ch, CURLOPT_FILE, $f_file);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(dirname(__FILE__) . '/body.tmp');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
array(1) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
===DONE===
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Mon Aug 18 18:28:27 2014 */
|
||||
/* Generated by re2c 0.13.5 on Tue Mar 31 16:32:03 2015 */
|
||||
#line 1 "ext/date/lib/parse_date.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -19864,9 +19864,9 @@ yy1315:
|
||||
|
||||
/* skip "last day of" or "first day of" */
|
||||
if (*ptr == 'l' || *ptr == 'L') {
|
||||
s->time->relative.first_last_day_of = 2;
|
||||
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
|
||||
} else {
|
||||
s->time->relative.first_last_day_of = 1;
|
||||
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
|
||||
}
|
||||
|
||||
TIMELIB_DEINIT;
|
||||
|
||||
@@ -1030,9 +1030,9 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
/* skip "last day of" or "first day of" */
|
||||
if (*ptr == 'l' || *ptr == 'L') {
|
||||
s->time->relative.first_last_day_of = 2;
|
||||
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH;
|
||||
} else {
|
||||
s->time->relative.first_last_day_of = 1;
|
||||
s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH;
|
||||
}
|
||||
|
||||
TIMELIB_DEINIT;
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
#define TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH 0x02
|
||||
#define TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH 0x03
|
||||
|
||||
#define TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH 0x01
|
||||
#define TIMELIB_SPECIAL_LAST_DAY_OF_MONTH 0x02
|
||||
|
||||
#ifndef LONG_MAX
|
||||
#define LONG_MAX 2147483647L
|
||||
#endif
|
||||
|
||||
+729
-672
File diff suppressed because it is too large.
Load diff
@@ -205,15 +205,17 @@ static void do_adjust_relative(timelib_time* time)
|
||||
time->m += time->relative.m;
|
||||
time->y += time->relative.y;
|
||||
}
|
||||
|
||||
switch (time->relative.first_last_day_of) {
|
||||
case 1: /* first */
|
||||
case TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH: /* first */
|
||||
time->d = 1;
|
||||
break;
|
||||
case 2: /* last */
|
||||
case TIMELIB_SPECIAL_LAST_DAY_OF_MONTH: /* last */
|
||||
time->d = 0;
|
||||
time->m++;
|
||||
break;
|
||||
}
|
||||
|
||||
timelib_do_normalize(time);
|
||||
}
|
||||
|
||||
@@ -296,6 +298,15 @@ static void do_adjust_special_early(timelib_time* time)
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (time->relative.first_last_day_of) {
|
||||
case TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH: /* first */
|
||||
time->d = 1;
|
||||
break;
|
||||
case TIMELIB_SPECIAL_LAST_DAY_OF_MONTH: /* last */
|
||||
time->d = 0;
|
||||
time->m++;
|
||||
break;
|
||||
}
|
||||
timelib_do_normalize(time);
|
||||
}
|
||||
|
||||
|
||||
+15
-14
@@ -85,6 +85,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_mktime, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, mon)
|
||||
ZEND_ARG_INFO(0, day)
|
||||
ZEND_ARG_INFO(0, year)
|
||||
ZEND_ARG_INFO(0, is_dst)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_gmmktime, 0, 0, 0)
|
||||
@@ -94,6 +95,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmmktime, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, mon)
|
||||
ZEND_ARG_INFO(0, day)
|
||||
ZEND_ARG_INFO(0, year)
|
||||
ZEND_ARG_INFO(0, is_dst)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_checkdate, 0)
|
||||
@@ -163,7 +165,7 @@ ZEND_END_ARG_INFO()
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_create_from_format, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, format)
|
||||
ZEND_ARG_INFO(0, time)
|
||||
ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 1)
|
||||
ZEND_ARG_INFO(0, object)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_parse, 0, 0, 1)
|
||||
@@ -2807,12 +2809,9 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
|
||||
timelib_tzinfo *tzi;
|
||||
php_timezone_obj *tzobj;
|
||||
|
||||
if (zend_hash_find(myht, "date", 5, (void**) &z_date) == SUCCESS) {
|
||||
convert_to_string(*z_date);
|
||||
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
|
||||
convert_to_long(*z_timezone_type);
|
||||
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
|
||||
convert_to_string(*z_timezone);
|
||||
if (zend_hash_find(myht, "date", 5, (void**) &z_date) == SUCCESS && Z_TYPE_PP(z_date) == IS_STRING) {
|
||||
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS && Z_TYPE_PP(z_timezone_type) == IS_LONG) {
|
||||
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS && Z_TYPE_PP(z_timezone) == IS_STRING) {
|
||||
|
||||
switch (Z_LVAL_PP(z_timezone_type)) {
|
||||
case TIMELIB_ZONETYPE_OFFSET:
|
||||
@@ -2827,7 +2826,6 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht
|
||||
|
||||
case TIMELIB_ZONETYPE_ID: {
|
||||
int ret;
|
||||
convert_to_string(*z_timezone);
|
||||
|
||||
tzi = php_date_parse_tzfile(Z_STRVAL_PP(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
|
||||
|
||||
@@ -3019,7 +3017,7 @@ void php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAMETERS, timelib_time *
|
||||
add_assoc_long(element, "weekdays", parsed_time->relative.special.amount);
|
||||
}
|
||||
if (parsed_time->relative.first_last_day_of) {
|
||||
add_assoc_bool(element, parsed_time->relative.first_last_day_of == 1 ? "first_day_of_month" : "last_day_of_month", 1);
|
||||
add_assoc_bool(element, parsed_time->relative.first_last_day_of == TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH ? "first_day_of_month" : "last_day_of_month", 1);
|
||||
}
|
||||
add_assoc_zval(return_value, "relative", element);
|
||||
}
|
||||
@@ -3744,9 +3742,8 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez
|
||||
zval **z_timezone = NULL;
|
||||
zval **z_timezone_type = NULL;
|
||||
|
||||
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
|
||||
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
|
||||
convert_to_long(*z_timezone_type);
|
||||
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS && Z_TYPE_PP(z_timezone_type) == IS_LONG) {
|
||||
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS && Z_TYPE_PP(z_timezone) == IS_STRING) {
|
||||
if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_PP(z_timezone) TSRMLS_CC)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -3771,7 +3768,9 @@ PHP_METHOD(DateTimeZone, __set_state)
|
||||
|
||||
php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC);
|
||||
tzobj = (php_timezone_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
|
||||
if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC) != SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone initialization failed");
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -3787,7 +3786,9 @@ PHP_METHOD(DateTimeZone, __wakeup)
|
||||
|
||||
myht = Z_OBJPROP_P(object);
|
||||
|
||||
php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC);
|
||||
if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC) != SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone initialization failed");
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D);
|
||||
|
||||
/* Grabbing CE's so that other exts can use the date objects too */
|
||||
PHPAPI zend_class_entry *php_date_get_date_ce(void);
|
||||
PHPAPI zend_class_entry *php_date_get_immutable_ce(void);
|
||||
PHPAPI zend_class_entry *php_date_get_timezone_ce(void);
|
||||
|
||||
/* Functions for creating DateTime objects, and initializing them from a string */
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #55407 (Impossible to prototype DateTime::createFromFormat)
|
||||
--INI--
|
||||
error_reporting=-1
|
||||
--FILE--
|
||||
<?php namespace melt\core;
|
||||
|
||||
class DateTime extends \DateTime {
|
||||
public static function createFromFormat($format, $time, DateTimeZone $timezone = null) {
|
||||
return new DateTime(parent::createFromFormat($format, $time, $timezone));
|
||||
}
|
||||
}
|
||||
|
||||
echo "DONE\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
DONE
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone).
|
||||
--FILE--
|
||||
<?php
|
||||
$data = unserialize('a:2:{i:0;O:12:"DateTimeZone":2:{s:13:"timezone_type";a:2:{i:0;i:1;i:1;i:2;}s:8:"timezone";s:1:"A";}i:1;R:4;}');
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: DateTimeZone::__wakeup(): Timezone initialization failed in %s/bug68942.php on line %d
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Bug #68942 (Use after free vulnerability in unserialize() with DateTime).
|
||||
--FILE--
|
||||
<?php
|
||||
$data = unserialize('a:2:{i:0;O:8:"DateTime":3:{s:4:"date";s:26:"2000-01-01 00:00:00.000000";s:13:"timezone_type";a:2:{i:0;i:1;i:1;i:2;}s:8:"timezone";s:1:"A";}i:1;R:5;}');
|
||||
var_dump($data);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Invalid serialization data for DateTime object in %s/bug68942_2.php on line %d
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #69336 (Issues with "last day of <monthname>")
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(date('d.m.Y',strtotime('last day of april')));
|
||||
var_dump(date('d.m.Y',strtotime('last tuesday of march 2015')));
|
||||
var_dump(date('d.m.Y',strtotime('last wednesday of march 2015')));
|
||||
var_dump(date('d.m.Y',strtotime('last wednesday of april 2015')));
|
||||
var_dump(date('d.m.Y',strtotime('last wednesday of march 2014')));
|
||||
var_dump(date('d.m.Y',strtotime('last wednesday of april 2014')));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(10) "30.04.%d"
|
||||
string(10) "31.03.2015"
|
||||
string(10) "25.03.2015"
|
||||
string(10) "29.04.2015"
|
||||
string(10) "26.03.2014"
|
||||
string(10) "30.04.2014"
|
||||
+59
-55
@@ -187,10 +187,10 @@ ZEND_END_ARG_INFO();
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* class DOMDocument extends DOMNode
|
||||
* class DOMDocument extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document
|
||||
* Since:
|
||||
* Since:
|
||||
*/
|
||||
|
||||
const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
|
||||
@@ -235,10 +235,10 @@ const zend_function_entry php_dom_document_class_functions[] = { /* {{{ */
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
/* {{{ docType DOMDocumentType
|
||||
readonly=yes
|
||||
/* {{{ docType DOMDocumentType
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
{
|
||||
@@ -266,15 +266,15 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ implementation DOMImplementation
|
||||
readonly=yes
|
||||
/* {{{ implementation DOMImplementation
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
{
|
||||
@@ -285,10 +285,10 @@ int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ documentElement DOMElement
|
||||
readonly=yes
|
||||
/* {{{ documentElement DOMElement
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
{
|
||||
@@ -384,8 +384,8 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ standalone boolean
|
||||
readonly=no
|
||||
/* {{{ standalone boolean
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-standalone
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -443,7 +443,7 @@ int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ version string
|
||||
/* {{{ version string
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-version
|
||||
Since: DOM Level 3
|
||||
@@ -501,8 +501,8 @@ int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ strictErrorChecking boolean
|
||||
readonly=no
|
||||
/* {{{ strictErrorChecking boolean
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -541,7 +541,7 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRML
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ formatOutput boolean
|
||||
/* {{{ formatOutput boolean
|
||||
readonly=no
|
||||
*/
|
||||
int dom_document_format_output_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
@@ -578,7 +578,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ validateOnParse boolean
|
||||
/* {{{ validateOnParse boolean
|
||||
readonly=no
|
||||
*/
|
||||
int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
@@ -615,7 +615,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ resolveExternals boolean
|
||||
/* {{{ resolveExternals boolean
|
||||
readonly=no
|
||||
*/
|
||||
int dom_document_resolve_externals_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
@@ -652,7 +652,7 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ preserveWhiteSpace boolean
|
||||
/* {{{ preserveWhiteSpace boolean
|
||||
readonly=no
|
||||
*/
|
||||
int dom_document_preserve_whitespace_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
@@ -689,7 +689,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ recover boolean
|
||||
/* {{{ recover boolean
|
||||
readonly=no
|
||||
*/
|
||||
int dom_document_recover_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
@@ -726,7 +726,7 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ substituteEntities boolean
|
||||
/* {{{ substituteEntities boolean
|
||||
readonly=no
|
||||
*/
|
||||
int dom_document_substitue_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
@@ -763,8 +763,8 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ documentURI string
|
||||
readonly=no
|
||||
/* {{{ documentURI string
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -820,8 +820,8 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ config DOMConfiguration
|
||||
readonly=yes
|
||||
/* {{{ config DOMConfiguration
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -836,7 +836,7 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_element)
|
||||
{
|
||||
@@ -869,7 +869,7 @@ PHP_FUNCTION(dom_document_create_element)
|
||||
|
||||
/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment();
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_document_fragment)
|
||||
{
|
||||
@@ -896,7 +896,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
|
||||
|
||||
/* {{{ proto DOMText dom_document_create_text_node(string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_text_node)
|
||||
{
|
||||
@@ -924,7 +924,7 @@ PHP_FUNCTION(dom_document_create_text_node)
|
||||
|
||||
/* {{{ proto DOMComment dom_document_create_comment(string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_comment)
|
||||
{
|
||||
@@ -952,7 +952,7 @@ PHP_FUNCTION(dom_document_create_comment)
|
||||
|
||||
/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_cdatasection)
|
||||
{
|
||||
@@ -980,7 +980,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
|
||||
|
||||
/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_processing_instruction)
|
||||
{
|
||||
@@ -1015,7 +1015,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
|
||||
|
||||
/* {{{ proto DOMAttr dom_document_create_attribute(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_attribute)
|
||||
{
|
||||
@@ -1049,7 +1049,7 @@ PHP_FUNCTION(dom_document_create_attribute)
|
||||
|
||||
/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_create_entity_reference)
|
||||
{
|
||||
@@ -1082,7 +1082,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
|
||||
|
||||
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094
|
||||
Since:
|
||||
Since:
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_get_elements_by_tag_name)
|
||||
{
|
||||
@@ -1116,7 +1116,7 @@ PHP_FUNCTION(dom_document_import_node)
|
||||
xmlDocPtr docp;
|
||||
xmlNodePtr nodep, retnodep;
|
||||
dom_object *intern, *nodeobj;
|
||||
int ret;
|
||||
int ret;
|
||||
long recursive = 0;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &id, dom_document_class_entry, &node, dom_node_class_entry, &recursive) == FAILURE) {
|
||||
@@ -1127,7 +1127,7 @@ PHP_FUNCTION(dom_document_import_node)
|
||||
|
||||
DOM_GET_OBJ(nodep, node, xmlNodePtr, nodeobj);
|
||||
|
||||
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
|
||||
if (nodep->type == XML_HTML_DOCUMENT_NODE || nodep->type == XML_DOCUMENT_NODE
|
||||
|| nodep->type == XML_DOCUMENT_TYPE_NODE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot import: Node Type Not Supported");
|
||||
RETURN_FALSE;
|
||||
@@ -1217,7 +1217,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
nodep->ns = nsptr;
|
||||
|
||||
DOM_RET_OBJ(nodep, &ret, intern);
|
||||
@@ -1519,11 +1519,15 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int sourc
|
||||
xmlInitParser();
|
||||
|
||||
if (mode == DOM_LOAD_FILE) {
|
||||
char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
|
||||
char *file_dest;
|
||||
if (CHECK_NULL_PATH(source, source_len)) {
|
||||
return NULL;
|
||||
}
|
||||
file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC);
|
||||
if (file_dest) {
|
||||
ctxt = xmlCreateFileParserCtxt(file_dest);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
ctxt = xmlCreateMemoryParserCtxt(source, source_len);
|
||||
}
|
||||
@@ -1845,7 +1849,7 @@ PHP_FUNCTION(dom_document_xinclude)
|
||||
zval *id;
|
||||
xmlDoc *docp;
|
||||
xmlNodePtr root;
|
||||
long flags = 0;
|
||||
long flags = 0;
|
||||
int err;
|
||||
dom_object *intern;
|
||||
|
||||
@@ -1858,7 +1862,7 @@ PHP_FUNCTION(dom_document_xinclude)
|
||||
err = xmlXIncludeProcessFlags(docp, flags);
|
||||
|
||||
/* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
|
||||
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
|
||||
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document
|
||||
but are not wanted in resulting document - must be done even if err as it could fail after
|
||||
having processed some xincludes */
|
||||
root = (xmlNodePtr) docp->children;
|
||||
@@ -1874,7 +1878,7 @@ PHP_FUNCTION(dom_document_xinclude)
|
||||
} else {
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1895,19 +1899,19 @@ PHP_FUNCTION(dom_document_validate)
|
||||
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
|
||||
|
||||
cvp = xmlNewValidCtxt();
|
||||
|
||||
|
||||
cvp->userData = NULL;
|
||||
cvp->error = (xmlValidityErrorFunc) php_libxml_error_handler;
|
||||
cvp->warning = (xmlValidityErrorFunc) php_libxml_error_handler;
|
||||
|
||||
|
||||
if (xmlValidateDocument(cvp, docp)) {
|
||||
RETVAL_TRUE;
|
||||
} else {
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
xmlFreeValidCtxt(cvp);
|
||||
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1948,7 +1952,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
|
||||
break;
|
||||
case DOM_LOAD_STRING:
|
||||
parser = xmlSchemaNewMemParserCtxt(source, source_len);
|
||||
/* If loading from memory, we need to set the base directory for the document
|
||||
/* If loading from memory, we need to set the base directory for the document
|
||||
but it is not apparent how to do that for schema's */
|
||||
break;
|
||||
default:
|
||||
@@ -2044,7 +2048,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
|
||||
break;
|
||||
case DOM_LOAD_STRING:
|
||||
parser = xmlRelaxNGNewMemParserCtxt(source, source_len);
|
||||
/* If loading from memory, we need to set the base directory for the document
|
||||
/* If loading from memory, we need to set the base directory for the document
|
||||
but it is not apparent how to do that for schema's */
|
||||
break;
|
||||
default:
|
||||
@@ -2112,10 +2116,10 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
int source_len, refcount, ret;
|
||||
long options = 0;
|
||||
htmlParserCtxtPtr ctxt;
|
||||
|
||||
|
||||
id = getThis();
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &source, &source_len, &options) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2148,7 +2152,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
||||
htmlParseDocument(ctxt);
|
||||
newdoc = ctxt->myDoc;
|
||||
htmlFreeParserCtxt(ctxt);
|
||||
|
||||
|
||||
if (!newdoc)
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -2270,13 +2274,13 @@ PHP_FUNCTION(dom_document_save_html)
|
||||
php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
buf = xmlBufferCreate();
|
||||
if (!buf) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (node->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
int one_size;
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@ assert.bail=true
|
||||
$doc = new DOMDocument();
|
||||
$result = $doc->loadHTMLFile("");
|
||||
assert('$result === false');
|
||||
$doc = new DOMDocument();
|
||||
$result = $doc->loadHTMLFile("text.html\0something");
|
||||
assert('$result === null');
|
||||
?>
|
||||
--EXPECTF--
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s
|
||||
|
||||
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile() expects parameter 1 to be a valid path, string given %s
|
||||
@@ -550,13 +550,12 @@ PHP_FUNCTION(enchant_broker_request_dict)
|
||||
|
||||
d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
|
||||
if (d) {
|
||||
pos = pbroker->dictcnt++;
|
||||
if (pbroker->dictcnt) {
|
||||
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
|
||||
pos = pbroker->dictcnt++;
|
||||
} else {
|
||||
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
|
||||
pos = 0;
|
||||
pbroker->dictcnt++;
|
||||
}
|
||||
|
||||
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
|
||||
@@ -607,14 +606,14 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
|
||||
|
||||
d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
|
||||
if (d) {
|
||||
pos = pbroker->dictcnt++;
|
||||
if (pbroker->dictcnt) {
|
||||
pos = pbroker->dictcnt++;
|
||||
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
|
||||
} else {
|
||||
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
|
||||
pos = 0;
|
||||
pbroker->dictcnt++;
|
||||
}
|
||||
|
||||
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
|
||||
dict->id = pos;
|
||||
dict->pbroker = pbroker;
|
||||
|
||||
@@ -117,7 +117,15 @@ int cflags;
|
||||
(NC-1)*sizeof(cat_t));
|
||||
if (g == NULL)
|
||||
return(REG_ESPACE);
|
||||
p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */
|
||||
{
|
||||
/* Patched for CERT Vulnerability Note VU#695940, Feb 2015. */
|
||||
size_t new_ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */
|
||||
if (new_ssize < len || new_ssize > LONG_MAX / sizeof(sop)) {
|
||||
free((char *) g);
|
||||
return REG_INVARG;
|
||||
}
|
||||
p->ssize = new_ssize;
|
||||
}
|
||||
p->strip = (sop *)malloc(p->ssize * sizeof(sop));
|
||||
p->slen = 0;
|
||||
if (p->strip == NULL) {
|
||||
@@ -1276,6 +1284,10 @@ int c;
|
||||
register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
|
||||
register unsigned uc = (unsigned char)c;
|
||||
|
||||
if (!g->setbits) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
|
||||
if (col[uc] != 0)
|
||||
return(1);
|
||||
|
||||
@@ -508,6 +508,11 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
|
||||
RETVAL_FALSE;
|
||||
goto clean;
|
||||
}
|
||||
if (CHECK_NULL_PATH(buffer, buffer_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
|
||||
RETVAL_FALSE;
|
||||
goto clean;
|
||||
}
|
||||
|
||||
wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -1072,6 +1072,9 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
|
||||
if (bytecnt > nbytes) {
|
||||
bytecnt = nbytes;
|
||||
}
|
||||
if (offset > bytecnt) {
|
||||
offset = bytecnt;
|
||||
}
|
||||
if (s == NULL) {
|
||||
ms->search.s_len = 0;
|
||||
ms->search.s = NULL;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #68819 Fileinfo on specific file causes spurious OOM and/or segfault, var 1
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$string = <<<HERE
|
||||
----a-----'''---------a---------------a--------a-----a-----a---------a-----as-------a----a--a-------------a--as-----s---------------a---------a---a--s-a-----a-----------asy---------a-----a-----------a----s--------a-------------a-------a--------a----s------------a-----a----------------a----s-----------------\r\n-------------------a-------a-a-------a-----a----a----s----s--------a-----------------------a----a----s-------------a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a----s----s--------a----------a----------------------a----a----s-------------a----------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n------a-------a-a-------a-----a----a---a-----a-----------------------a----a---a-----a------------------s-------a----a---a-----a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s------\r\n-------------------a-------a-a-------a-----a----a---a-------a------------------------a----a---a-----''--a-------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a-------s-----a---a-------------------------a----a-------------a---a-------------------s-------a----a-------------a---a-----as-a--------------a-----a--s----s---------y------------a-----a-s---a-------''----a---s--a-''------''----s------------a-y----------------s------a-----y--a-s--a-s------s--a-s----------''----------------------------a---s--a----a---------a-s---a-s--------s--------a---------s--a-y-------------as----a----a-------------a------a---s--a-s------a--------a----s----y--as--a----a-s---------------a-----a--------------------------------------\r\n-------------------a-------a-a-------a-----a----a-----------s--------a-----------------------a----a--------------------a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a-----------s--------a----------a----------------------a----a--------------------a------------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a---a-----------------------a----a---a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a---a----------a----------------------a----a---a------------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-----a-a-----------a-------a-a-------a-----a----a----a---s-----a-----------------------a----a----a---------a-----------------s-------a----a----a---------a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a--------a----a-----------------------a----a----------a----a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-----a-------------a-------a-a-------a-----a----a--------s-----a---a-------------------------a----a--------------a---a-------------------s-------------a---------------a----a---a---a-----as-a--------------a-----a--s----s---------y------------a-----a-s---a-------''----a---s--a-''------''----s------------a-y----------------s------a-----y--a-s--a-s------s--a-s----------''----------------------------a---s--a----a---------a-s---a-s--------s--------a---------s--a-y-------------as----a----a-------------a------a---s--a-s------a--------a----s----y--as--a----a-s---------------a-----a-----------Line truncated
|
||||
HERE;
|
||||
|
||||
$finfo = new finfo();
|
||||
$type = $finfo->buffer($string);
|
||||
|
||||
var_dump($type);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(60) "ASCII text, with very long lines, with CRLF line terminators"
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #68819 Fileinfo on specific file causes spurious OOM and/or segfault, var 2
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$string = '';
|
||||
|
||||
// These two in any order
|
||||
$string .= "\r\n";
|
||||
$string .= "''''";
|
||||
|
||||
// Total string length > 8192
|
||||
$string .= str_repeat(chr(rand(32, 127)), 8184);
|
||||
|
||||
// Ending in this string
|
||||
$string .= "say";
|
||||
|
||||
$finfo = new finfo();
|
||||
$type = $finfo->buffer($string);
|
||||
var_dump($type);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(60) "ASCII text, with very long lines, with CRLF line terminators"
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #68996 (Invalid free of CG(interned_empty_string))
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("USE_ZEND_ALLOC") !== "0") {
|
||||
print "skip Need Zend MM disabled";
|
||||
}
|
||||
?>
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
--INI--
|
||||
html_errors=1
|
||||
--FILE--
|
||||
<?php
|
||||
finfo_open(FILEINFO_MIME_TYPE, "\xfc\x63");
|
||||
?>
|
||||
--EXPECTF--
|
||||
<br />
|
||||
<b>Warning</b>: : failed to open stream: No such file or directory in <b>%sbug68996.php</b> on line <b>%d</b><br />
|
||||
<br />
|
||||
<b>Warning</b>: : failed to open stream: No such file or directory in <b>%sbug68996.php</b> on line <b>%d</b><br />
|
||||
<br />
|
||||
<b>Warning</b>: finfo_open(): in <b>%sbug68996.php</b> on line <b>%d</b><br />
|
||||
@@ -19,6 +19,7 @@ echo "*** Testing finfo_file() : basic functionality ***\n";
|
||||
var_dump( finfo_file( $finfo, __FILE__) );
|
||||
var_dump( finfo_file( $finfo, __FILE__, FILEINFO_CONTINUE ) );
|
||||
var_dump( finfo_file( $finfo, $magicFile ) );
|
||||
var_dump( finfo_file( $finfo, $magicFile.chr(0).$magicFile) );
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
@@ -27,4 +28,7 @@ var_dump( finfo_file( $finfo, $magicFile ) );
|
||||
string(28) "text/x-php; charset=us-ascii"
|
||||
string(22) "PHP script, ASCII text"
|
||||
string(25) "text/plain; charset=utf-8"
|
||||
|
||||
Warning: finfo_file(): Invalid path in %s/finfo_file_basic.php on line %d
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -113,7 +113,7 @@ static void php_filter_strip(zval *value, long flags)
|
||||
int i, c;
|
||||
|
||||
/* Optimization for if no strip flags are set */
|
||||
if (! ((flags & FILTER_FLAG_STRIP_LOW) || (flags & FILTER_FLAG_STRIP_HIGH)) ) {
|
||||
if (!(flags & (FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ static void php_filter_strip(zval *value, long flags)
|
||||
buf = safe_emalloc(1, Z_STRLEN_P(value) + 1, 1);
|
||||
c = 0;
|
||||
for (i = 0; i < Z_STRLEN_P(value); i++) {
|
||||
if ((str[i] > 127) && (flags & FILTER_FLAG_STRIP_HIGH)) {
|
||||
if ((str[i] >= 127) && (flags & FILTER_FLAG_STRIP_HIGH)) {
|
||||
} else if ((str[i] < 32) && (flags & FILTER_FLAG_STRIP_LOW)) {
|
||||
} else if ((str[i] == '`') && (flags & FILTER_FLAG_STRIP_BACKTICK)) {
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #69202 (FILTER_FLAG_STRIP_BACKTICK ignored unless other flags are used)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("filter")) die("skip"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_BACKTICK));
|
||||
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK));
|
||||
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK));
|
||||
var_dump(filter_var("``a`b`c``", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "abc"
|
||||
string(3) "abc"
|
||||
string(3) "abc"
|
||||
string(9) "``a`b`c``"
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #69203 (FILTER_FLAG_STRIP_HIGH doesn't strip ASCII 127)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("filter")) die("skip"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(filter_var("\x7f", FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH));
|
||||
var_dump(filter_var("\x7f", FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH));
|
||||
var_dump(filter_var("\x7f", FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_HIGH));
|
||||
var_dump(filter_var("\x7f", FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_HIGH));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
+4
-4
@@ -1432,7 +1432,7 @@ PHP_FUNCTION(imageloadfont)
|
||||
gdFontPtr font;
|
||||
php_stream *stream;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_name) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2369,7 +2369,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
long ignore_warning;
|
||||
|
||||
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
if (width < 1 || height < 1) {
|
||||
@@ -2377,7 +2377,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &file, &file_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -4046,7 +4046,7 @@ PHP_FUNCTION(imagepsencodefont)
|
||||
char *enc, **enc_vector;
|
||||
int enc_len, *f_ind;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp", &fnt, &enc, &enc_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
/*********************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#if (!defined(__OpenBSD__)) && HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifndef NULL
|
||||
|
||||
@@ -3,7 +3,7 @@ Testing that imageloadfont() breaks on non-string first parameter
|
||||
--CREDITS--
|
||||
Neveo Harrison <neveoo [at] gmail [dot] com> #testfest #tek11
|
||||
--SKIPIF--
|
||||
<?php
|
||||
<?php
|
||||
if (!extension_loaded("gd")) die("skip GD not present");
|
||||
?>
|
||||
--FILE--
|
||||
@@ -11,5 +11,5 @@ Neveo Harrison <neveoo [at] gmail [dot] com> #testfest #tek11
|
||||
var_dump( imageloadfont(array()) );
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imageloadfont() expects parameter 1 to be string, array given in %s on line %d
|
||||
NULL
|
||||
Warning: imageloadfont() expects parameter 1 to be a valid path, array given in %s on line %d
|
||||
NULL
|
||||
+6
-1
@@ -143,6 +143,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
|
||||
}
|
||||
if (isfilename) {
|
||||
if (CHECK_NULL_PATH(data, data_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
|
||||
@@ -258,6 +259,10 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (isfilename) {
|
||||
if (CHECK_NULL_PATH(data, data_len)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
|
||||
if (!stream) {
|
||||
/* Stream will report errors opening file */
|
||||
@@ -462,7 +467,7 @@ PHP_FUNCTION(hash_update_file)
|
||||
char *filename, buf[1024];
|
||||
int filename_len, n;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ hash_hmac_file('crc32', $file, $key, TRUE, $extra_arg);
|
||||
echo "\n-- Testing hash_hmac_file() function with invalid hash algorithm --\n";
|
||||
hash_hmac_file('foo', $file, $key, TRUE);
|
||||
|
||||
echo "\n-- Testing hash_hmac_file() function with bad path --\n";
|
||||
hash_hmac_file('crc32', $file.chr(0).$file, $key, TRUE);
|
||||
|
||||
?>
|
||||
===Done===
|
||||
--EXPECTF--
|
||||
@@ -51,4 +54,8 @@ Warning: hash_hmac_file() expects at most 4 parameters, 5 given in %s on line %d
|
||||
-- Testing hash_hmac_file() function with invalid hash algorithm --
|
||||
|
||||
Warning: hash_hmac_file(): Unknown hashing algorithm: foo in %s on line %d
|
||||
|
||||
-- Testing hash_hmac_file() function with bad path --
|
||||
|
||||
Warning: hash_hmac_file(): Invalid path in %s on line %d
|
||||
===Done===
|
||||
@@ -1194,14 +1194,12 @@ static int strToMatch(const char* str ,char *retstr)
|
||||
char* anchor = NULL;
|
||||
const char* anchor1 = NULL;
|
||||
int result = 0;
|
||||
int len = 0;
|
||||
|
||||
if( (!str) || str[0] == '\0'){
|
||||
return result;
|
||||
} else {
|
||||
anchor = retstr;
|
||||
anchor1 = str;
|
||||
len = strlen(str);
|
||||
while( (*str)!='\0' ){
|
||||
if( *str == '-' ){
|
||||
*retstr = '_';
|
||||
|
||||
+12
-16
@@ -427,25 +427,21 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
|
||||
if ((type = is_numeric_string(s, len, &p, &d, 0)) != 0) {
|
||||
if (type == IS_LONG) {
|
||||
smart_str_append_long(buf, p);
|
||||
} else if (type == IS_DOUBLE) {
|
||||
if (!zend_isinf(d) && !zend_isnan(d)) {
|
||||
char num[NUM_BUF_SIZE];
|
||||
int l;
|
||||
return;
|
||||
} else if (type == IS_DOUBLE && !zend_isinf(d) && !zend_isnan(d)) {
|
||||
char num[NUM_BUF_SIZE];
|
||||
int l;
|
||||
|
||||
php_gcvt(d, EG(precision), '.', 'e', (char *)num);
|
||||
l = strlen(num);
|
||||
if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && l < NUM_BUF_SIZE - 2) {
|
||||
num[l++] = '.';
|
||||
num[l++] = '0';
|
||||
num[l] = '\0';
|
||||
}
|
||||
smart_str_appendl(buf, num, l);
|
||||
} else {
|
||||
JSON_G(error_code) = PHP_JSON_ERROR_INF_OR_NAN;
|
||||
smart_str_appendc(buf, '0');
|
||||
php_gcvt(d, EG(precision), '.', 'e', (char *)num);
|
||||
l = strlen(num);
|
||||
if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && l < NUM_BUF_SIZE - 2) {
|
||||
num[l++] = '.';
|
||||
num[l++] = '0';
|
||||
num[l] = '\0';
|
||||
}
|
||||
smart_str_appendl(buf, num, l);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #64695 JSON_NUMERIC_CHECK has issues with strings that are numbers plus the letter e
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("json")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$t = array('test' => '123343e871700');
|
||||
var_dump(json_encode($t, JSON_NUMERIC_CHECK));
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
string(24) "{"test":"123343e871700"}"
|
||||
Done
|
||||
@@ -306,6 +306,21 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
|
||||
(xmlStrncmp(BAD_CAST uri->scheme, BAD_CAST "file", 4) == 0))) {
|
||||
resolved_path = xmlURIUnescapeString(filename, 0, NULL);
|
||||
isescaped = 1;
|
||||
#if LIBXML_VERSION >= 20902 && defined(PHP_WIN32)
|
||||
/* Libxml 2.9.2 prefixes local paths with file:/ instead of file://,
|
||||
thus the php stream wrapper will fail on a valid case. For this
|
||||
reason the prefix is rather better cut off. */
|
||||
{
|
||||
size_t pre_len = sizeof("file:/") - 1;
|
||||
|
||||
if (strncasecmp(resolved_path, "file:/", pre_len) == 0
|
||||
&& '/' != resolved_path[pre_len]) {
|
||||
xmlChar *tmp = xmlStrdup(resolved_path + pre_len);
|
||||
xmlFree(resolved_path);
|
||||
resolved_path = tmp;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
resolved_path = (char *)filename;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ mbfl_filt_conv_gb18030_wchar(int c, mbfl_convert_filter *filter)
|
||||
if (((c1 >= 0x81 && c1 <= 0x84) || (c1 >= 0x90 && c1 <= 0xe3)) &&
|
||||
c2 >= 0x30 && c2 <= 0x39 && c3 >= 0x81 && c3 <= 0xfe && c >= 0x30 && c <= 0x39) {
|
||||
if (c1 >= 0x90 && c1 <= 0xe3) {
|
||||
w = ((c1 - 0x90)*10 + (c2 - 0x30)*126 + (c3 - 0x81))*10 + (c - 0x30) + 0x10000;
|
||||
w = ((((c1 - 0x90)*10 + (c2 - 0x30))*126 + (c3 - 0x81)))*10 + (c - 0x30) + 0x10000;
|
||||
} else { /* Unicode BMP */
|
||||
w = (((c1 - 0x81)*10 + (c2 - 0x30))*126 + (c3 - 0x81))*10 + (c - 0x30);
|
||||
if (w >= 0 && w <= 39419) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #68846 False detection of CJK Unified Ideographs Extension E
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
"\x00\x02\x0b\xb7" === mb_convert_encoding("\x95\x34\xb2\x35", 'UTF-32', 'GB18030')
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
$driver = new mysqli_driver;
|
||||
|
||||
$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost";
|
||||
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
|
||||
$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "127.0.0.1";
|
||||
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3308;
|
||||
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
|
||||
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
|
||||
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
|
||||
|
||||
+57
-14
@@ -99,12 +99,17 @@ AC_DEFUN([PHP_ODBC_FIND_EMPRESS_BCS_LIBS],[
|
||||
dnl
|
||||
dnl configure options
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(odbcver,,
|
||||
[ --with-odbcver[=HEX] Force support for the passed ODBC version. A hex number is expected, default 0x0300.
|
||||
Use the special value of 0 to prevent an explicit ODBCVER to be defined. ], 0x0300)
|
||||
|
||||
if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(adabas,,
|
||||
[ --with-adabas[=DIR] Include Adabas D support [/usr/local]])
|
||||
|
||||
AC_MSG_CHECKING([for Adabas support])
|
||||
if test "$PHP_ADABAS" != "no"; then
|
||||
AC_MSG_CHECKING([for Adabas support])
|
||||
if test "$PHP_ADABAS" = "yes"; then
|
||||
PHP_ADABAS=/usr/local
|
||||
fi
|
||||
@@ -123,6 +128,8 @@ PHP_ARG_WITH(adabas,,
|
||||
PHP_ODBC_CHECK_HEADER(sqlext.h)
|
||||
AC_DEFINE(HAVE_ADABAS,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -130,8 +137,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(sapdb,,
|
||||
[ --with-sapdb[=DIR] Include SAP DB support [/usr/local]])
|
||||
|
||||
AC_MSG_CHECKING([for SAP DB support])
|
||||
if test "$PHP_SAPDB" != "no"; then
|
||||
AC_MSG_CHECKING([for SAP DB support])
|
||||
if test "$PHP_SAPDB" = "yes"; then
|
||||
PHP_SAPDB=/usr/local
|
||||
fi
|
||||
@@ -141,6 +148,8 @@ PHP_ARG_WITH(sapdb,,
|
||||
ODBC_TYPE=sapdb
|
||||
AC_DEFINE(HAVE_SAPDB,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -148,8 +157,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(solid,,
|
||||
[ --with-solid[=DIR] Include Solid support [/usr/local/solid]])
|
||||
|
||||
AC_MSG_CHECKING(for Solid support)
|
||||
if test "$PHP_SOLID" != "no"; then
|
||||
AC_MSG_CHECKING(for Solid support)
|
||||
if test "$PHP_SOLID" = "yes"; then
|
||||
PHP_SOLID=/usr/local/solid
|
||||
fi
|
||||
@@ -166,6 +175,8 @@ PHP_ARG_WITH(solid,,
|
||||
fi
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
PHP_ODBC_FIND_SOLID_LIBS($ODBC_LIBDIR)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -173,8 +184,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(ibm-db2,,
|
||||
[ --with-ibm-db2[=DIR] Include IBM DB2 support [/home/db2inst1/sqllib]])
|
||||
|
||||
AC_MSG_CHECKING(for IBM DB2 support)
|
||||
if test "$PHP_IBM_DB2" != "no"; then
|
||||
AC_MSG_CHECKING(for IBM DB2 support)
|
||||
if test "$PHP_IBM_DB2" = "yes"; then
|
||||
ODBC_INCDIR=/home/db2inst1/sqllib/include
|
||||
ODBC_LIBDIR=/home/db2inst1/sqllib/lib
|
||||
@@ -203,6 +214,8 @@ You need to source your DB2 environment before running PHP configure:
|
||||
], [
|
||||
$ODBC_LFLAGS $ODBC_LIBS
|
||||
])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -210,8 +223,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(ODBCRouter,,
|
||||
[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support [/usr]])
|
||||
|
||||
AC_MSG_CHECKING(for ODBCRouter.com support)
|
||||
if test "$PHP_ODBCROUTER" != "no"; then
|
||||
AC_MSG_CHECKING(for ODBCRouter.com support)
|
||||
if test "$PHP_ODBCROUTER" = "yes"; then
|
||||
PHP_ODBCROUTER=/usr
|
||||
fi
|
||||
@@ -223,6 +236,8 @@ PHP_ARG_WITH(ODBCRouter,,
|
||||
ODBC_TYPE=ODBCRouter
|
||||
AC_DEFINE(HAVE_ODBC_ROUTER,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -231,8 +246,8 @@ PHP_ARG_WITH(empress,,
|
||||
[ --with-empress[=DIR] Include Empress support [\$EMPRESSPATH]
|
||||
(Empress Version >= 8.60 required)])
|
||||
|
||||
AC_MSG_CHECKING(for Empress support)
|
||||
if test "$PHP_EMPRESS" != "no"; then
|
||||
AC_MSG_CHECKING(for Empress support)
|
||||
if test "$PHP_EMPRESS" = "yes"; then
|
||||
ODBC_INCDIR=$EMPRESSPATH/include/odbc
|
||||
ODBC_LIBDIR=$EMPRESSPATH/shlib
|
||||
@@ -246,6 +261,8 @@ PHP_ARG_WITH(empress,,
|
||||
AC_DEFINE(HAVE_EMPRESS,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
PHP_ODBC_FIND_EMPRESS_LIBS($ODBC_LIBDIR)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -255,8 +272,8 @@ PHP_ARG_WITH(empress-bcs,,
|
||||
Include Empress Local Access support [\$EMPRESSPATH]
|
||||
(Empress Version >= 8.60 required)])
|
||||
|
||||
AC_MSG_CHECKING(for Empress local access support)
|
||||
if test "$PHP_EMPRESS_BCS" != "no"; then
|
||||
AC_MSG_CHECKING(for Empress local access support)
|
||||
if test "$PHP_EMPRESS_BCS" = "yes"; then
|
||||
ODBC_INCDIR=$EMPRESSPATH/include/odbc
|
||||
ODBC_LIBDIR=$EMPRESSPATH/shlib
|
||||
@@ -286,6 +303,8 @@ PHP_ARG_WITH(empress-bcs,,
|
||||
AC_DEFINE(HAVE_EMPRESS,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
PHP_ODBC_FIND_EMPRESS_BCS_LIBS($ODBC_LIBDIR)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -293,8 +312,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(birdstep,,
|
||||
[ --with-birdstep[=DIR] Include Birdstep support [/usr/local/birdstep]])
|
||||
|
||||
AC_MSG_CHECKING(for Birdstep support)
|
||||
if test "$PHP_BIRDSTEP" != "no"; then
|
||||
AC_MSG_CHECKING(for Birdstep support)
|
||||
if test "$PHP_BIRDSTEP" = "yes"; then
|
||||
ODBC_INCDIR=/usr/local/birdstep/include
|
||||
ODBC_LIBDIR=/usr/local/birdstep/lib
|
||||
@@ -333,6 +352,8 @@ PHP_ARG_WITH(birdstep,,
|
||||
|
||||
AC_DEFINE(HAVE_BIRDSTEP,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -347,8 +368,8 @@ PHP_ARG_WITH(custom-odbc,,
|
||||
LDFLAGS=-lunix
|
||||
CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"])
|
||||
|
||||
AC_MSG_CHECKING(for a custom ODBC support)
|
||||
if test "$PHP_CUSTOM_ODBC" != "no"; then
|
||||
AC_MSG_CHECKING(for a custom ODBC support)
|
||||
if test "$PHP_CUSTOM_ODBC" = "yes"; then
|
||||
PHP_CUSTOM_ODBC=/usr/local
|
||||
fi
|
||||
@@ -360,15 +381,17 @@ PHP_ARG_WITH(custom-odbc,,
|
||||
ODBC_TYPE=custom-odbc
|
||||
AC_DEFINE(HAVE_CODBC,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(iodbc,,
|
||||
[ --with-iodbc[=DIR] Include iODBC support])
|
||||
[ --with-iodbc[=DIR] Include iODBC support [/usr/local]])
|
||||
|
||||
AC_MSG_CHECKING(for iODBC support)
|
||||
if test "$PHP_IODBC" != "no"; then
|
||||
AC_MSG_CHECKING(for iODBC support)
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
@@ -396,6 +419,8 @@ PHP_ARG_WITH(iodbc,,
|
||||
AC_DEFINE(HAVE_ODBC2,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -403,8 +428,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(esoob,,
|
||||
[ --with-esoob[=DIR] Include Easysoft OOB support [/usr/local/easysoft/oob/client]])
|
||||
|
||||
AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support)
|
||||
if test "$PHP_ESOOB" != "no"; then
|
||||
AC_MSG_CHECKING(for Easysoft ODBC-ODBC Bridge support)
|
||||
if test "$PHP_ESOOB" = "yes"; then
|
||||
PHP_ESOOB=/usr/local/easysoft/oob/client
|
||||
fi
|
||||
@@ -416,6 +441,8 @@ PHP_ARG_WITH(esoob,,
|
||||
ODBC_TYPE=esoob
|
||||
AC_DEFINE(HAVE_ESOOB,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -423,8 +450,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(unixODBC,,
|
||||
[ --with-unixODBC[=DIR] Include unixODBC support [/usr/local]])
|
||||
|
||||
AC_MSG_CHECKING(for unixODBC support)
|
||||
if test "$PHP_UNIXODBC" != "no"; then
|
||||
AC_MSG_CHECKING(for unixODBC support)
|
||||
if test "$PHP_UNIXODBC" = "yes"; then
|
||||
PHP_UNIXODBC=/usr/local
|
||||
fi
|
||||
@@ -437,6 +464,8 @@ PHP_ARG_WITH(unixODBC,,
|
||||
PHP_ODBC_CHECK_HEADER(sqlext.h)
|
||||
AC_DEFINE(HAVE_UNIXODBC,1,[ ])
|
||||
AC_MSG_RESULT([$ext_output])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -444,8 +473,8 @@ if test -z "$ODBC_TYPE"; then
|
||||
PHP_ARG_WITH(dbmaker,,
|
||||
[ --with-dbmaker[=DIR] Include DBMaker support])
|
||||
|
||||
AC_MSG_CHECKING(for DBMaker support)
|
||||
if test "$PHP_DBMAKER" != "no"; then
|
||||
AC_MSG_CHECKING(for DBMaker support)
|
||||
if test "$PHP_DBMAKER" = "yes"; then
|
||||
# find dbmaker's home directory
|
||||
DBMAKER_HOME=`grep "^dbmaker:" /etc/passwd | $AWK -F: '{print $6}'`
|
||||
@@ -487,9 +516,20 @@ PHP_ARG_WITH(dbmaker,,
|
||||
PHP_ADD_INCLUDE($ODBC_INCDIR)
|
||||
ODBC_STATIC="libphpext_odbc.la"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "no" != "$PHP_ODBCVER"; then
|
||||
if test "$PHP_ODBCVER" != "0"; then
|
||||
AC_DEFINE_UNQUOTED(ODBCVER, $PHP_ODBCVER, [ The highest supported ODBC version ])
|
||||
fi
|
||||
else
|
||||
AC_DEFINE(ODBCVER, 0x0300, [ The highest supported ODBC version ])
|
||||
fi
|
||||
|
||||
|
||||
dnl
|
||||
dnl Extension setup
|
||||
dnl
|
||||
@@ -511,4 +551,7 @@ if test -n "$ODBC_TYPE"; then
|
||||
PHP_SUBST_OLD(ODBC_TYPE)
|
||||
|
||||
PHP_NEW_EXTENSION(odbc, php_odbc.c, $ext_shared,, $ODBC_INCLUDE)
|
||||
else
|
||||
AC_MSG_CHECKING([for any ODBC driver support])
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
+7
-1
@@ -2,6 +2,7 @@
|
||||
// vim:ft=javascript
|
||||
|
||||
ARG_ENABLE("odbc", "ODBC support", "yes");
|
||||
ARG_WITH("odbcver", "Force support for the passed ODBC version. A hex number is expected, default 0x0300. Use the special value of 0 to prevent an explicit ODBCVER to be defined.", "0x0300");
|
||||
|
||||
if (PHP_ODBC == "yes") {
|
||||
if (CHECK_LIB("odbc32.lib", "odbc") && CHECK_LIB("odbccp32.lib", "odbc")
|
||||
@@ -9,8 +10,13 @@ if (PHP_ODBC == "yes") {
|
||||
&& CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
|
||||
EXTENSION("odbc", "php_odbc.c");
|
||||
AC_DEFINE("HAVE_UODBC", 1, "ODBC support");
|
||||
if ("no" == PHP_ODBCVER) {
|
||||
AC_DEFINE("ODBCVER", "0x0300", "The highest supported ODBC version", false);
|
||||
} else if ("0" != PHP_ODBCVER) {
|
||||
AC_DEFINE("ODBCVER", PHP_ODBCVER, "The highest supported ODBC version", false);
|
||||
}
|
||||
} else {
|
||||
WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
|
||||
PHP_ODBC = "no"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@
|
||||
#define PHP_ODBC_H
|
||||
|
||||
#if HAVE_UODBC
|
||||
#define ODBCVER 0x0250
|
||||
|
||||
#ifdef ZTS
|
||||
#include "TSRM.h"
|
||||
|
||||
@@ -25,12 +25,6 @@
|
||||
|
||||
#if HAVE_UODBC
|
||||
|
||||
#define ODBCVER 0x0250
|
||||
/*#ifndef MSVC5
|
||||
#define FAR
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* checking in the same order as in configure.in */
|
||||
|
||||
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) /* Solid Server */
|
||||
|
||||
@@ -82,10 +82,10 @@ static void optimize_func_calls(zend_op_array *op_array, zend_persistent_script
|
||||
case ZEND_FETCH_DIM_FUNC_ARG:
|
||||
if (call_stack[call - 1].func) {
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(call_stack[call - 1].func, (opline->extended_value & ZEND_FETCH_ARG_MASK))) {
|
||||
opline->extended_value = 0;
|
||||
opline->extended_value &= ZEND_FETCH_TYPE_MASK;
|
||||
opline->opcode -= 9;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
opline->extended_value &= ZEND_FETCH_TYPE_MASK;
|
||||
opline->opcode -= 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +380,12 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
|
||||
func->type == ZEND_INTERNAL_FUNCTION &&
|
||||
func->module->type == MODULE_PERSISTENT) {
|
||||
zval t;
|
||||
ZVAL_BOOL(&t, 1);
|
||||
if (Z_STRLEN(ZEND_OP1_LITERAL(opline)) == sizeof("is_callable") - 1 ||
|
||||
func->handler != ZEND_FN(display_disabled_function)) {
|
||||
ZVAL_BOOL(&t, 1);
|
||||
} else {
|
||||
ZVAL_BOOL(&t, 0);
|
||||
}
|
||||
if (replace_var_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
|
||||
literal_dtor(&ZEND_OP1_LITERAL(opline - 1));
|
||||
MAKE_NOP((opline - 1));
|
||||
|
||||
@@ -269,6 +269,7 @@ static void update_op2_const(zend_op_array *op_array,
|
||||
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
|
||||
case ZEND_ADD_ARRAY_ELEMENT:
|
||||
case ZEND_INIT_ARRAY:
|
||||
case ZEND_ASSIGN_DIM:
|
||||
case ZEND_UNSET_DIM:
|
||||
case ZEND_FETCH_DIM_R:
|
||||
case ZEND_FETCH_DIM_W:
|
||||
@@ -331,6 +332,42 @@ static int replace_var_by_const(zend_op_array *op_array,
|
||||
}
|
||||
opline->opcode = ZEND_SEND_VAL;
|
||||
break;
|
||||
case ZEND_SWITCH_FREE:
|
||||
case ZEND_CASE: {
|
||||
zend_op *m, *n;
|
||||
int brk = op_array->last_brk_cont;
|
||||
while (brk--) {
|
||||
if (op_array->brk_cont_array[brk].start <= (opline - op_array->opcodes) &&
|
||||
op_array->brk_cont_array[brk].brk > (opline - op_array->opcodes)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
m = opline;
|
||||
n = op_array->opcodes + op_array->brk_cont_array[brk].brk + 1;
|
||||
while (m < n) {
|
||||
if (ZEND_OP1_TYPE(m) == IS_VAR &&
|
||||
ZEND_OP1(m).var == var) {
|
||||
if (m->opcode == ZEND_CASE) {
|
||||
zval old_val;
|
||||
old_val = *val;
|
||||
zval_copy_ctor(val);
|
||||
update_op1_const(op_array, m, val TSRMLS_CC);
|
||||
*val = old_val;
|
||||
} else if (m->opcode == ZEND_SWITCH_FREE) {
|
||||
MAKE_NOP(m);
|
||||
} else {
|
||||
ZEND_ASSERT(0);
|
||||
}
|
||||
}
|
||||
m++;
|
||||
}
|
||||
zval_dtor(val);
|
||||
return 1;
|
||||
}
|
||||
case ZEND_FREE:
|
||||
MAKE_NOP(opline);
|
||||
zval_dtor(val);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -373,18 +410,47 @@ static void replace_tmp_by_const(zend_op_array *op_array,
|
||||
* and allows its reuse. The number of ZEND_CASE instructions
|
||||
* usually terminated by ZEND_FREE that finally kills the value.
|
||||
*/
|
||||
if (opline->opcode == ZEND_CASE) {
|
||||
zval old_val;
|
||||
old_val = *val;
|
||||
zval_copy_ctor(val);
|
||||
update_op1_const(op_array, opline, val TSRMLS_CC);
|
||||
*val = old_val;
|
||||
} else if (opline->opcode == ZEND_FREE) {
|
||||
MAKE_NOP(opline);
|
||||
if (opline->opcode == ZEND_CASE || opline->opcode == ZEND_FREE) {
|
||||
zend_op *m, *n;
|
||||
int brk = op_array->last_brk_cont;
|
||||
zend_bool in_switch = 0;
|
||||
while (brk--) {
|
||||
if (op_array->brk_cont_array[brk].start <= (opline - op_array->opcodes) &&
|
||||
op_array->brk_cont_array[brk].brk > (opline - op_array->opcodes)) {
|
||||
in_switch = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_switch) {
|
||||
MAKE_NOP(opline);
|
||||
zval_dtor(val);
|
||||
break;
|
||||
}
|
||||
|
||||
m = opline;
|
||||
n = op_array->opcodes + op_array->brk_cont_array[brk].brk + 1;
|
||||
while (m < n) {
|
||||
if (ZEND_OP1_TYPE(m) == IS_TMP_VAR &&
|
||||
ZEND_OP1(m).var == var) {
|
||||
if (m->opcode == ZEND_CASE) {
|
||||
zval old_val;
|
||||
old_val = *val;
|
||||
zval_copy_ctor(val);
|
||||
update_op1_const(op_array, m, val TSRMLS_CC);
|
||||
*val = old_val;
|
||||
} else if (m->opcode == ZEND_FREE) {
|
||||
MAKE_NOP(m);
|
||||
} else {
|
||||
ZEND_ASSERT(0);
|
||||
}
|
||||
}
|
||||
m++;
|
||||
}
|
||||
zval_dtor(val);
|
||||
break;
|
||||
} else {
|
||||
update_op1_const(op_array, opline, val TSRMLS_CC);
|
||||
val = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -394,14 +460,10 @@ static void replace_tmp_by_const(zend_op_array *op_array,
|
||||
|
||||
update_op2_const(op_array, opline, val TSRMLS_CC);
|
||||
/* TMP_VAR may be used only once */
|
||||
val = NULL;
|
||||
break;
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
if (val) {
|
||||
zval_dtor(val);
|
||||
}
|
||||
}
|
||||
|
||||
#include "Optimizer/nop_removal.c"
|
||||
|
||||
@@ -582,7 +582,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
|
||||
ZCSG(force_restart_time) = 0;
|
||||
while (mem_usage_check->l_pid > 0) {
|
||||
while (tries--) {
|
||||
zend_accel_error(ACCEL_LOG_INFO, "Killed locker %d", mem_usage_check->l_pid);
|
||||
zend_accel_error(ACCEL_LOG_ERROR, "Killed locker %d", mem_usage_check->l_pid);
|
||||
if (kill(mem_usage_check->l_pid, SIGKILL)) {
|
||||
break;
|
||||
}
|
||||
@@ -595,7 +595,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
|
||||
usleep(10000);
|
||||
}
|
||||
if (!tries) {
|
||||
zend_accel_error(ACCEL_LOG_INFO, "Can't kill %d after 20 tries!", mem_usage_check->l_pid);
|
||||
zend_accel_error(ACCEL_LOG_ERROR, "Can't kill %d after 20 tries!", mem_usage_check->l_pid);
|
||||
ZCSG(force_restart_time) = time(NULL); /* restore forced restart request */
|
||||
}
|
||||
|
||||
@@ -1336,23 +1336,6 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO
|
||||
if (file_handle->type == ZEND_HANDLE_STREAM &&
|
||||
(!strstr(file_handle->filename, ".phar") ||
|
||||
strstr(file_handle->filename, "://"))) {
|
||||
char *buf;
|
||||
size_t size;
|
||||
|
||||
/* Stream callbacks needs to be called in context of original
|
||||
* function and class tables (see: https://bugs.php.net/bug.php?id=64353)
|
||||
*/
|
||||
if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) {
|
||||
*op_array_p = NULL;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ZCG(accel_directives).validate_timestamps ||
|
||||
ZCG(accel_directives).file_update_protection ||
|
||||
ZCG(accel_directives).max_file_size > 0) {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
--TEST--
|
||||
Bug #69038 (switch(SOMECONSTANT) misbehaves)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function a($a = "bad") {
|
||||
|
||||
switch (PHP_OS) {
|
||||
case "LALALALA" : return "LALALAL";
|
||||
case PHP_OS: return "okey";
|
||||
default: break;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
var_dump(a());
|
||||
|
||||
|
||||
function b($b = "bad") {
|
||||
switch (PHP_OS) {
|
||||
case "LALALAL": return "bad";
|
||||
case PHP_OS:
|
||||
switch (PHP_OS) {
|
||||
case "FOO": break;
|
||||
case PHP_OS: return "okey";
|
||||
default :
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return $b;
|
||||
}
|
||||
var_dump(b());
|
||||
|
||||
function c($b = "bad") {
|
||||
switch (extension_loaded("standard")) {
|
||||
case 0 : return "LALALAL";
|
||||
case 1 : return "okey";
|
||||
default : return "bad";
|
||||
}
|
||||
}
|
||||
var_dump(c());
|
||||
|
||||
function d() {
|
||||
switch (PHP_OS) {
|
||||
default: return "bad";
|
||||
case PHP_OS: return "okey";
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(d());
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "okey"
|
||||
string(4) "okey"
|
||||
string(4) "okey"
|
||||
string(4) "okey"
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #69125 (Array numeric string as key)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const SZERO = '0';
|
||||
const SONE = '1';
|
||||
|
||||
$array[SZERO] = "okey";
|
||||
$array[1] = "okey";
|
||||
|
||||
var_dump($array[SZERO]);
|
||||
var_dump($array[SONE]);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "okey"
|
||||
string(4) "okey"
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #69159 (Opcache causes problem when passing a variable variable to a function)
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.optimization_level=-1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$i = 1;
|
||||
$x1 = "okey";
|
||||
myFunction(${"x$i"});
|
||||
|
||||
function myFunction($x) {
|
||||
var_dump($x);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(4) "okey"
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Test that script cached info is correct with validate_timestamps disabled
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.validate_timestamps=0
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(opcache_is_script_cached(__FILE__));
|
||||
var_dump(opcache_is_script_cached("nonexistent.php"));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -4,6 +4,7 @@ Test that script cached info is correct
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.validate_timestamps=1
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
|
||||
@@ -324,14 +324,16 @@ static int filename_is_in_cache(char *filename, int filename_len TSRMLS_DC)
|
||||
persistent_script = zend_accel_hash_find(&ZCSG(hash), filename, filename_len + 1);
|
||||
if (persistent_script) {
|
||||
return !persistent_script->corrupted &&
|
||||
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
|
||||
(!ZCG(accel_directives).validate_timestamps ||
|
||||
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
if ((key = accel_make_persistent_key_ex(&handle, filename_len, &key_length TSRMLS_CC)) != NULL) {
|
||||
persistent_script = zend_accel_hash_find(&ZCSG(hash), key, key_length + 1);
|
||||
return persistent_script && !persistent_script->corrupted &&
|
||||
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS;
|
||||
(!ZCG(accel_directives).validate_timestamps ||
|
||||
validate_timestamp_and_record(persistent_script, &handle TSRMLS_CC) == SUCCESS);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -346,10 +346,10 @@ void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source TSRML
|
||||
retval = ZCG(mem);;
|
||||
ZCG(mem) = (void*)(((char*)ZCG(mem)) + ZEND_ALIGNED_SIZE(size));
|
||||
memcpy(retval, source, size);
|
||||
zend_shared_alloc_register_xlat_entry(source, retval);
|
||||
if (free_source) {
|
||||
interned_efree((char*)source);
|
||||
}
|
||||
zend_shared_alloc_register_xlat_entry(source, retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ typedef struct _handler_entry {
|
||||
|
||||
typedef struct _zend_shared_memory_state {
|
||||
int *positions; /* current positions for each segment */
|
||||
int shared_free; /* amount of free shared memory */
|
||||
size_t shared_free; /* amount of free shared memory */
|
||||
} zend_shared_memory_state;
|
||||
|
||||
typedef struct _zend_smm_shared_globals {
|
||||
|
||||
@@ -21,6 +21,7 @@ if test "$PHP_OPENSSL" != "no"; then
|
||||
|
||||
AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later]))
|
||||
AC_CHECK_LIB(crypto, X509_free, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later]))
|
||||
AC_CHECK_FUNCS([RAND_egd])
|
||||
|
||||
PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD,
|
||||
[
|
||||
|
||||
+11
-8
@@ -975,11 +975,13 @@ static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *se
|
||||
|
||||
if (file == NULL) {
|
||||
file = RAND_file_name(buffer, sizeof(buffer));
|
||||
#ifdef HAVE_RAND_EGD
|
||||
} else if (RAND_egd(file) > 0) {
|
||||
/* if the given filename is an EGD socket, don't
|
||||
* write anything back to it */
|
||||
*egdsocket = 1;
|
||||
return SUCCESS;
|
||||
#endif
|
||||
}
|
||||
if (file == NULL || !RAND_load_file(file, -1)) {
|
||||
if (RAND_status() == 0) {
|
||||
@@ -1532,7 +1534,7 @@ cleanup:
|
||||
efree(spkstr);
|
||||
}
|
||||
|
||||
if (strlen(s) <= 0) {
|
||||
if (s && strlen(s) <= 0) {
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
|
||||
@@ -1927,7 +1929,7 @@ PHP_FUNCTION(openssl_x509_parse)
|
||||
zval ** zcert;
|
||||
X509 * cert = NULL;
|
||||
long certresource = -1;
|
||||
int i;
|
||||
int i, sig_nid;
|
||||
zend_bool useshortnames = 1;
|
||||
char * tmpstr;
|
||||
zval * subitem;
|
||||
@@ -1974,11 +1976,12 @@ PHP_FUNCTION(openssl_x509_parse)
|
||||
if (tmpstr) {
|
||||
add_assoc_string(return_value, "alias", tmpstr, 1);
|
||||
}
|
||||
/*
|
||||
add_assoc_long(return_value, "signaturetypeLONG", X509_get_signature_type(cert));
|
||||
add_assoc_string(return_value, "signaturetype", OBJ_nid2sn(X509_get_signature_type(cert)), 1);
|
||||
add_assoc_string(return_value, "signaturetypeLN", OBJ_nid2ln(X509_get_signature_type(cert)), 1);
|
||||
*/
|
||||
|
||||
sig_nid = OBJ_obj2nid((cert)->sig_alg->algorithm);
|
||||
add_assoc_string(return_value, "signatureTypeSN", (char*)OBJ_nid2sn(sig_nid), 1);
|
||||
add_assoc_string(return_value, "signatureTypeLN", (char*)OBJ_nid2ln(sig_nid), 1);
|
||||
add_assoc_long(return_value, "signatureTypeNID", sig_nid);
|
||||
|
||||
MAKE_STD_ZVAL(subitem);
|
||||
array_init(subitem);
|
||||
|
||||
@@ -4278,7 +4281,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
|
||||
char * outfilename; int outfilename_len;
|
||||
char * extracertsfilename = NULL; int extracertsfilename_len;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZZa!|lp",
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ppZZa!|lp!",
|
||||
&infilename, &infilename_len, &outfilename, &outfilename_len,
|
||||
&zcert, &zprivkey, &zheaders, &flags, &extracertsfilename,
|
||||
&extracertsfilename_len) == FAILURE) {
|
||||
|
||||
@@ -8,50 +8,21 @@ if (!defined('OPENSSL_KEYTYPE_EC')) die("skip no EC available");
|
||||
--FILE--
|
||||
<?php
|
||||
$cert = file_get_contents(__DIR__.'/bug64802.pem');
|
||||
$r = openssl_x509_parse($cert,$use_short_names=true);
|
||||
sort($r['subject']);
|
||||
var_dump( $r['subject'] );
|
||||
$r = openssl_x509_parse($cert,$use_short_names=false);
|
||||
var_dump($r['subject']['commonName']);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(11) {
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(14) "1550 Bryant st"
|
||||
string(9) "www.rd.io"
|
||||
[1]=>
|
||||
string(5) "94103"
|
||||
string(8) "rdio.com"
|
||||
[2]=>
|
||||
string(7) "4586007"
|
||||
string(5) "rd.io"
|
||||
[3]=>
|
||||
string(2) "CA"
|
||||
string(12) "api.rdio.com"
|
||||
[4]=>
|
||||
string(26) "COMODO EV Multi-Domain SSL"
|
||||
string(9) "api.rd.io"
|
||||
[5]=>
|
||||
string(20) "Private Organization"
|
||||
[6]=>
|
||||
string(10) "Rdio, Inc."
|
||||
[7]=>
|
||||
string(13) "San Francisco"
|
||||
[8]=>
|
||||
string(2) "US"
|
||||
[9]=>
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(2) "US"
|
||||
[1]=>
|
||||
string(8) "Delaware"
|
||||
}
|
||||
[10]=>
|
||||
array(6) {
|
||||
[0]=>
|
||||
string(9) "www.rd.io"
|
||||
[1]=>
|
||||
string(8) "rdio.com"
|
||||
[2]=>
|
||||
string(5) "rd.io"
|
||||
[3]=>
|
||||
string(12) "api.rdio.com"
|
||||
[4]=>
|
||||
string(9) "api.rd.io"
|
||||
[5]=>
|
||||
string(12) "www.rdio.com"
|
||||
}
|
||||
string(12) "www.rdio.com"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #67403: Add signatureType to openssl_x509_parse
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
--FILE--
|
||||
<?php
|
||||
$r = openssl_x509_parse(file_get_contents(__DIR__.'/bug64802.pem'));
|
||||
var_dump($r['signatureTypeSN']);
|
||||
var_dump($r['signatureTypeLN']);
|
||||
var_dump($r['signatureTypeNID']);
|
||||
|
||||
$r = openssl_x509_parse(file_get_contents(__DIR__.'/bug37820cert.pem'));
|
||||
var_dump($r['signatureTypeSN']);
|
||||
var_dump($r['signatureTypeLN']);
|
||||
var_dump($r['signatureTypeNID']);
|
||||
--EXPECTF--
|
||||
string(8) "RSA-SHA1"
|
||||
string(21) "sha1WithRSAEncryption"
|
||||
int(65)
|
||||
string(7) "RSA-MD5"
|
||||
string(20) "md5WithRSAEncryption"
|
||||
int(8)
|
||||
@@ -0,0 +1,33 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIuw/AFD7RWcMCAggA
|
||||
MBQGCCqGSIb3DQMHBAh98F6GmaGn1ASCAoBpzaFxyttEhyh4dhMjarJIqTz24DjO
|
||||
yZnp1K5qthejSYx2P28uUsh+gQOh6F2jbVAq++eAWkTBGuc4pWhhoT7nY8vhf0Y0
|
||||
6yTlVrTxuI/8MNo/lfa0xE/+ZD4B5zp0hQxfij4GTd8l6V/kpXMgiYD1JmIXArm7
|
||||
sucn+9XV3RucsTBpeIJ1nLEDfpbyEWqNfhoyskQ+S3I6HkMgELI9JpsO6OR9fh1Q
|
||||
ttdoYxBU+YjoDYcSWRGkTGrJFeGGhTQzz+L2ijgoqNWDSfrLBoQR1bqNVUuw6gcE
|
||||
9PpA/vpRlxcHbUNNkOWft+4e0tV3I2EqscEcsYeNbd2Ta4yu7f6pk4/Kxn40wrQ8
|
||||
6Ss9GZylghaFth2xppL/vpmGaCC7FqpZRh+NKqjlcBobIkwyRcsQrPHB0CYLPHA4
|
||||
yak/dNTY8L5K8Rtd5XG3+E41CoDF6ssNY0Kw7l9kAn/neDVh+WnQkWIiWPmq210a
|
||||
p4L/uiXRK7aYi+UqKJ5+svayNw2w1dkqpbeejwLq2F1+ek/447JFPVJcvP8Nm7sr
|
||||
04Mcg+ZHusZdjiWEv4W6CBq8o6eF2JdhfpSDgPkHwiZ/EarHfx0vcYIMJhlEQBmk
|
||||
a/XsZPk2wnamKSPfJautO3MIus0M6SniWF6eDA4/AZzSjXV8Vc0unb6lc+Nc8tJa
|
||||
6MU1soTsmki/YraCmQswqpL+kXFZVeHuLowOC5oH+CimQoscmiZ9tBvpnYo6XwEZ
|
||||
S9jZRIBQ77oMku+rlMPfz2FURgVXZpEfrGmxKvA5Vt3ojrYfTwwD2YqZHVcm39zy
|
||||
iKqA1qVt7A2A90ILMAzYnN0VRE4SO3yIDN1ZBp5OOY61AduPrhpaHl81
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICdjCCAd+gAwIBAgIJAPbIVRT31Al2MA0GCSqGSIb3DQEBCwUAMFgxCzAJBgNV
|
||||
BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
|
||||
Q29tcGFueSBMdGQxFDASBgNVBAMMC3BocCB0ZXN0IGNhMB4XDTE1MDMwNTA2MTYz
|
||||
MFoXDTI1MDMwMjA2MTYzMFowUjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlNDMRUw
|
||||
EwYDVQQHDAxNeXJ0bGUgQmVhY2gxDDAKBgNVBAsMA1BIUDERMA8GA1UEAwwIdGVz
|
||||
dC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKp5gxUbKvY5eFwZJti0
|
||||
6d6YBo400Or6M+bLfIMnz5C1WQ7dMfiQpeFLpSIlOIaFqyrqkeeR9k5dsx1K9FOu
|
||||
PAJ4+lmWA4R93RpdJFz8kmQoNu3P59JMATXi8wvNBIrN/Vc08NT0wBRImeyQSVHd
|
||||
UcFIXBEbBM0dQsPKQ1k8n5WDAgMBAAGjTjBMMAkGA1UdEwQCMAAwCwYDVR0PBAQD
|
||||
AgXgMDIGA1UdEQQrMCmCEmRlYnMuYWstb25saW5lLmJlLoITZGVicy5hay1vbmxp
|
||||
bmUubmV0LjANBgkqhkiG9w0BAQsFAAOBgQB8PaLt+IX690UIbHKuko4qAdc5SzWA
|
||||
Vbm3D4StZeFwWQbZbBGFCDn0/0ON0iDv4JUgZnaX84mBDPczN26QG2PJND0Cggmi
|
||||
umylEVYhclPF4RoGcoKd3jT2igzDNyzk/lu+NUtRv/Nj161ds9vb9XiOrEkPn8Ne
|
||||
mzz3wA0D5A65lw==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,41 @@
|
||||
--TEST--
|
||||
Bug #68265: SAN match fails with trailing DNS dot
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
if (!function_exists("proc_open")) die("skip no proc_open");
|
||||
--FILE--
|
||||
<?php
|
||||
$serverCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
|
||||
$serverCtx = stream_context_create(['ssl' => [
|
||||
'local_cert' => __DIR__ . '/bug68265.pem',
|
||||
'passphrase' => 'elephpant',
|
||||
]]);
|
||||
|
||||
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
|
||||
phpt_notify();
|
||||
|
||||
stream_socket_accept($server, 30);
|
||||
CODE;
|
||||
|
||||
$clientCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$clientFlags = STREAM_CLIENT_CONNECT;
|
||||
$clientCtx = stream_context_create(['ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => true,
|
||||
'peer_name' => 'debs.ak-online.net',
|
||||
]]);
|
||||
|
||||
phpt_wait();
|
||||
|
||||
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
|
||||
CODE;
|
||||
|
||||
include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
resource(%d) of type (stream)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIuw/AFD7RWcMCAggA
|
||||
MBQGCCqGSIb3DQMHBAh98F6GmaGn1ASCAoBpzaFxyttEhyh4dhMjarJIqTz24DjO
|
||||
yZnp1K5qthejSYx2P28uUsh+gQOh6F2jbVAq++eAWkTBGuc4pWhhoT7nY8vhf0Y0
|
||||
6yTlVrTxuI/8MNo/lfa0xE/+ZD4B5zp0hQxfij4GTd8l6V/kpXMgiYD1JmIXArm7
|
||||
sucn+9XV3RucsTBpeIJ1nLEDfpbyEWqNfhoyskQ+S3I6HkMgELI9JpsO6OR9fh1Q
|
||||
ttdoYxBU+YjoDYcSWRGkTGrJFeGGhTQzz+L2ijgoqNWDSfrLBoQR1bqNVUuw6gcE
|
||||
9PpA/vpRlxcHbUNNkOWft+4e0tV3I2EqscEcsYeNbd2Ta4yu7f6pk4/Kxn40wrQ8
|
||||
6Ss9GZylghaFth2xppL/vpmGaCC7FqpZRh+NKqjlcBobIkwyRcsQrPHB0CYLPHA4
|
||||
yak/dNTY8L5K8Rtd5XG3+E41CoDF6ssNY0Kw7l9kAn/neDVh+WnQkWIiWPmq210a
|
||||
p4L/uiXRK7aYi+UqKJ5+svayNw2w1dkqpbeejwLq2F1+ek/447JFPVJcvP8Nm7sr
|
||||
04Mcg+ZHusZdjiWEv4W6CBq8o6eF2JdhfpSDgPkHwiZ/EarHfx0vcYIMJhlEQBmk
|
||||
a/XsZPk2wnamKSPfJautO3MIus0M6SniWF6eDA4/AZzSjXV8Vc0unb6lc+Nc8tJa
|
||||
6MU1soTsmki/YraCmQswqpL+kXFZVeHuLowOC5oH+CimQoscmiZ9tBvpnYo6XwEZ
|
||||
S9jZRIBQ77oMku+rlMPfz2FURgVXZpEfrGmxKvA5Vt3ojrYfTwwD2YqZHVcm39zy
|
||||
iKqA1qVt7A2A90ILMAzYnN0VRE4SO3yIDN1ZBp5OOY61AduPrhpaHl81
|
||||
-----END ENCRYPTED PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICkTCCAfqgAwIBAgIJAPbIVRT31Al1MA0GCSqGSIb3DQEBCwUAMFgxCzAJBgNV
|
||||
BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
|
||||
Q29tcGFueSBMdGQxFDASBgNVBAMMC3BocCB0ZXN0IGNhMB4XDTE1MDMwNTA0NTQx
|
||||
NVoXDTI1MDMwMjA0NTQxNVowUjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlNDMRUw
|
||||
EwYDVQQHDAxNeXJ0bGUgQmVhY2gxDDAKBgNVBAsMA1BIUDERMA8GA1UEAwwIdGVz
|
||||
dC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKp5gxUbKvY5eFwZJti0
|
||||
6d6YBo400Or6M+bLfIMnz5C1WQ7dMfiQpeFLpSIlOIaFqyrqkeeR9k5dsx1K9FOu
|
||||
PAJ4+lmWA4R93RpdJFz8kmQoNu3P59JMATXi8wvNBIrN/Vc08NT0wBRImeyQSVHd
|
||||
UcFIXBEbBM0dQsPKQ1k8n5WDAgMBAAGjaTBnMAkGA1UdEwQCMAAwCwYDVR0PBAQD
|
||||
AgXgME0GA1UdEQRGMESCCHRlc3QuY29tggx3d3cudGVzdC5jb22CEnN1YmRvbWFp
|
||||
bi50ZXN0LmNvbYcQAAAAAAAAAAAAAP//CgIAAYcECgIAATANBgkqhkiG9w0BAQsF
|
||||
AAOBgQBZ4TptNXV85gNj3wcB5feWFcwKO8cN4hwnhrbqiHN280r9O/g1CQiLmB4K
|
||||
2txrJt06UNCnvWse7CdvsN14wu6rRGRk/+7M36NBw5ERkAzp5HXgZUWVdMl3YltB
|
||||
PpqbLhGGrkVn7/jW2FdAxfax7qaGDYgC3qcQNfiK6K92SPxV7Q==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,41 @@
|
||||
--TEST--
|
||||
Bug #68879: Match IP address fields in subjectAltName checks
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
if (!function_exists("proc_open")) die("skip no proc_open");
|
||||
--FILE--
|
||||
<?php
|
||||
$serverCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
|
||||
$serverCtx = stream_context_create(['ssl' => [
|
||||
'local_cert' => __DIR__ . '/bug68879.pem',
|
||||
'passphrase' => 'elephpant',
|
||||
]]);
|
||||
|
||||
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
|
||||
phpt_notify();
|
||||
|
||||
stream_socket_accept($server, 30);
|
||||
CODE;
|
||||
|
||||
$clientCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$clientFlags = STREAM_CLIENT_CONNECT;
|
||||
$clientCtx = stream_context_create(['ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => true,
|
||||
'peer_name' => '10.2.0.1',
|
||||
]]);
|
||||
|
||||
phpt_wait();
|
||||
|
||||
var_dump(stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $clientCtx));
|
||||
CODE;
|
||||
|
||||
include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
resource(%d) of type (stream)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #68912 (Segmentation fault at openssl_spki_new)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
if (!@openssl_pkey_new()) die("skip cannot create private key");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$var1=xml_parser_create_ns();
|
||||
$var2=2;
|
||||
$var3=3;
|
||||
|
||||
openssl_spki_new($var1, $var2, $var3);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: openssl_spki_new(): supplied resource is not a valid OpenSSL X.509/key resource in %sbug68912.php on line %d
|
||||
|
||||
Warning: openssl_spki_new(): Unable to use supplied private key in %sbug68912.php on line %d
|
||||
@@ -0,0 +1,81 @@
|
||||
--TEST--
|
||||
Bug #68920: peer_fingerprint input checks should be strict
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
if (!function_exists("proc_open")) die("skip no proc_open");
|
||||
--FILE--
|
||||
<?php
|
||||
$serverCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
|
||||
$serverCtx = stream_context_create(['ssl' => [
|
||||
'local_cert' => __DIR__ . '/san-cert.pem',
|
||||
]]);
|
||||
|
||||
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
|
||||
phpt_notify();
|
||||
|
||||
stream_socket_accept($server, 30);
|
||||
stream_socket_accept($server, 30);
|
||||
stream_socket_accept($server, 30);
|
||||
stream_socket_accept($server, 30);
|
||||
CODE;
|
||||
|
||||
$clientCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$clientFlags = STREAM_CLIENT_CONNECT;
|
||||
|
||||
phpt_wait();
|
||||
|
||||
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => true]]);
|
||||
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
|
||||
var_dump($sock);
|
||||
|
||||
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => null]]);
|
||||
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
|
||||
var_dump($sock);
|
||||
|
||||
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => []]]);
|
||||
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
|
||||
var_dump($sock);
|
||||
|
||||
$ctx = stream_context_create(['ssl' => ['verify_peer'=> false, 'peer_fingerprint' => ['foo']]]);
|
||||
$sock = stream_socket_client($serverUri, $errno, $errstr, 30, $clientFlags, $ctx);
|
||||
var_dump($sock);
|
||||
CODE;
|
||||
|
||||
include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
Warning: stream_socket_client(): Expected peer fingerprint must be a string or an array in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stream_socket_client(): Expected peer fingerprint must be a string or an array in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stream_socket_client(): Invalid peer_fingerprint array; [algo => fingerprint] form required in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): peer_fingerprint match failure in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: stream_socket_client(): Invalid peer_fingerprint array; [algo => fingerprint] form required in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): peer_fingerprint match failure in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): unable to connect to %s (Unknown error) in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,16 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICfjCCAeegAwIBAgIJAMO7Amv3ZHJBMA0GCSqGSIb3DQEBCwUAMFgxCzAJBgNV
|
||||
BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
|
||||
Q29tcGFueSBMdGQxFDASBgNVBAMMC3BocCB0ZXN0IGNhMB4XDTE1MDMwMzE3NTQz
|
||||
OVoXDTI1MDIyODE3NTQzOVowWDELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1
|
||||
bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDEUMBIGA1UEAwwL
|
||||
cGhwIHRlc3QgY2EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKac+r8AzEEk
|
||||
Cdnue7nx3gxmsXTYzwnywjjGJSknoWCdNEE+LqtT8RU0J+V76w4ehWRnhLVtu//v
|
||||
3InsrpcniGfTcov60NelHQOfn5XCCV5zqVi628WddwwdVw4AI58K3YrNk450VCBu
|
||||
dMy6m2Tm+dQwgVbtR+nIwzfm47CMWW2DAgMBAAGjUDBOMB0GA1UdDgQWBBTtMxRr
|
||||
plep4RW3PjhosYsIdIoMojAfBgNVHSMEGDAWgBTtMxRrplep4RW3PjhosYsIdIoM
|
||||
ojAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBADMF2pL8jCF6PFPhMuFN
|
||||
zxoLSuy6uLAkjkujo5e33kSUW5MI4jT/aoL2hnBPA4uJPC/TZXoBHKBpnPES2GkJ
|
||||
r7tOR51Jsk7HRTdvOMkcdD9Fe+M+Q5rOMUlCtyX/SRhc1uFnC2//Y/rx4Tc8djGl
|
||||
RqrH/Oi38u1083krmNRQNw/Z
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,32 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,CE3DEB59F7DF7AF4
|
||||
|
||||
9REujZuwDkwoN949Gw77c3aJiQvwoPiUXJ+cDirn4ii56OsHBSCWfCe4Mqn976GK
|
||||
9IAPwHJ5yRewPpFvb+xRqtMtnm8S7HIfVtZqW4FkG+g/paEg6rwqVpW78Jco/gww
|
||||
6XFGrmU1bwKWrB05YV1BWnbB4L7Q+/U0ZcNvdNISOBW//2HuHeKVWe1DKoaRtoVz
|
||||
v4BFQxr7F3A9tm3vz9Jn2JreVrihdWQVlVTVOsfiQk/yPVA7twxiT2Hfimp/gFSX
|
||||
l28rA+jB7xd6IhpA/EXAYnCbxSp9kSXYtba26dO3rQHlgRv1a38AwvCD/3igQzF/
|
||||
XjetX2a75ITi5c7bUT4ZpVX8ZPU8oVBqSo6MXisFWBT0Svx+KhWyyn2V0z66APdR
|
||||
X1V6dZiAcqN7giRg3Yj/lMDo0nV4Ph+Ce7p3Mv/p4qU0mxf7O8sPhp7DloHQFEF0
|
||||
HyooNp26YT4V47NDxwIlkoj9YZ5nkO/svQ1qxiTKWNUdfWw5r3lFiAw5xTyDDiBs
|
||||
Sz776DaFo3Ss3JSUr5RLe4rEEc02iVqYB9OPXoUaUwS+//1KKgzF3xq/yxsJM5dR
|
||||
ljphraCViZzJPw4z69Lmao9CPRfDxKChVOSLkKgmFIOeronLdTypieanc3/o002c
|
||||
2ecb/x9f7G2XAn0iwcfylMkSZHirxqaos8LodsPxg8GdNJT89C66n+EJerrFwi6i
|
||||
qT0EvNfkbxYd3zj82+j1weNFLsQuB0O1UJBWEdyj74gIX+4HkZpSYLQ2O8MTz3yE
|
||||
52JcRRyl9ECdNJw15jkDQIusUreYMHb7YW+u+3+ci21H94Iay5XSYw==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKDCCAZECCQD2yFUU99QJdzANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJY
|
||||
WDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZhdWx0IENvbXBh
|
||||
bnkgTHRkMRQwEgYDVQQDDAtwaHAgdGVzdCBjYTAeFw0xNTAzMTAyMzM0MDNaFw0y
|
||||
NTAzMDcyMzM0MDNaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJTQzEVMBMGA1UE
|
||||
BwwMTXlydGxlIEJlYWNoMQwwCgYDVQQLDANQSFAxGDAWBgNVBAMMD2J1ZzY5MjE1
|
||||
LWNsaWVudDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyLTbIGryqx0wGDD+
|
||||
xdrJsrcwXFyTYpCOHUaxl1wt/6j6u7yW5m4TJFEDUtIGnqBGYiPE9iynkLkOwUF/
|
||||
IpheONJENIjXkdSJPUEy/Ggz9WOa0qO6dQZU44NpGO7LFW97HglBIsbhioOsdcf/
|
||||
INAgidoMJNizkuTBNRGW7iKp0lsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQBKkZLQ
|
||||
aU12/cPvW5e9AXArnE9jxMhnzuCKy81eHj30CC/nHpId9i5YZytHcZEZyEOWE6DQ
|
||||
IsqmsP5ZheXq26mUtHOcEdEgcqcXTRotKXFwIxTZxP5jkCRn0xGbeHh7H9pg6TP0
|
||||
QekWTkWCh5qcf3NXvJtk4TCfLC6FSjehHkq9yQ==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,32 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,4C7155D678EDABFA
|
||||
|
||||
NdOGB8UpC5xrnCFIOzxV6s4y4PZlxgX8s+iL/JeGVmS7a8pDSTzbb6wjauYy3n/2
|
||||
KCywHsFdAjifi8SGHJOJBVep3GS7dWw979vWdiKjQEAlJpoouv6P58Xpn4jDf1uX
|
||||
ZrpmSTXI0iH7HYE2pzrkxPbg0Cz5GV2d2VlL7U5d4+UxXh8fSBndgHligmoc8mCU
|
||||
1AG7ZmvPhMDTewhR333qKBYi9TBZuw75Crpy5CjPO30vBMfZpseOvtEnmI0JYGwe
|
||||
75Q3e6sgY0o9b7Q42+g9v+FpGBTHhmldwYD7k1TtOC/PT4eO68E3mDawR2v+X9r8
|
||||
4jL22d3tB4Q4qAfBwbR37umTaQHLIxtjzc2OjXb/Ju35LW9d0hEuaAQK3oY8yeEi
|
||||
gctYWrCN4K+cxZQwq1+ulpkHXULGs9QxXT9KJYfV1+HWkauWUSycFhA74jWW0mL5
|
||||
InlGaFf6oiRrP4lgRVXD3rtTLCwkCD2JcvTbF+re9+vCpui7zPW2peGwcE/W7TiK
|
||||
wHFJhQQyYGcAWsal7ekXshTLoz4jeaPgak7dg50ZjjwcWr0bJuJ3RRaocMhYZ6Bd
|
||||
DiF30nCijVSJfrLhugN2RJmSysT4WNXn5qaDGEOhVgkXZscZ3ClFGsMnxAz9sqbJ
|
||||
J+ZMbqxkwSIf/+dPfhnjOWm3HPpP3T9wioYZT7KuI98pfGnHMZmX5CaJ6d/uBO5G
|
||||
8jMvQLWOx+1WoDfWDkn7SfNDyTg4/dEo5IJFXv2S9zSPynCnQcBkYUevIfJ7vDo/
|
||||
7pXCkcY+C1zssW8R1J+WNbHI1syzVbvSg6hlgyEPXuDbErCRqiFm1g==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICKDCCAZECCQD2yFUU99QJeDANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJY
|
||||
WDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZhdWx0IENvbXBh
|
||||
bnkgTHRkMRQwEgYDVQQDDAtwaHAgdGVzdCBjYTAeFw0xNTAzMTAyMzM1MjFaFw0y
|
||||
NTAzMDcyMzM1MjFaMFkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJTQzEVMBMGA1UE
|
||||
BwwMTXlydGxlIEJlYWNoMQwwCgYDVQQLDANQSFAxGDAWBgNVBAMMD2J1ZzY5MjE1
|
||||
LXNlcnZlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAup0kaIwQufxQWXmE
|
||||
QWbd7yxMQ69UHRhbb2stAo7qxmYMeH3bWCaR/oAPOswjtkXZQgyj0slLAWJDXKDg
|
||||
zCnEKsU2yWLnvQy/h1rq/kBIybMoLKMIkRZQtrGcApKJtyrq8OtTz6odKQ7k9hym
|
||||
DtPF+2lcVhSAd+qjngF3txrVKjsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQCfXuL4
|
||||
TODLV54uKKVdVGwr8U3EQ3JdYOqN3Hr9kpmxe6StIcLxQ1e+mSDgKcixzw6CXN3P
|
||||
f++8NugAt4Ja2SDqqw1gzrX+9u6KZpnMKpEDIK0Z3Ss51ZwqilAXmFVybNTyYeVo
|
||||
HweM1IY/zrBpSTQv/aKs1R2Pyb0Heindnp0PUQ==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #69215: Crypto servers should send client CA list
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip openssl not loaded");
|
||||
if (!function_exists("proc_open")) die("skip no proc_open");
|
||||
--FILE--
|
||||
<?php
|
||||
$serverCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN;
|
||||
$serverCtx = stream_context_create(['ssl' => [
|
||||
'local_cert' => __DIR__ . '/bug69215-server.pem',
|
||||
'passphrase' => 'elephpant',
|
||||
'cafile' => __DIR__ . '/bug69215-ca.pem',
|
||||
'verify_peer' => true,
|
||||
'verify_peer_name' => true,
|
||||
'peer_name' => 'bug69215-client',
|
||||
]]);
|
||||
|
||||
$server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx);
|
||||
phpt_notify();
|
||||
|
||||
stream_socket_accept($server, 30);
|
||||
CODE;
|
||||
|
||||
$clientCode = <<<'CODE'
|
||||
$serverUri = "ssl://127.0.0.1:64321";
|
||||
$clientFlags = STREAM_CLIENT_CONNECT;
|
||||
$clientCtx = stream_context_create(['ssl' => [
|
||||
'local_cert' => __DIR__ . '/bug69215-client.pem',
|
||||
'passphrase' => 'elephpant',
|
||||
'cafile' => __DIR__ . '/bug69215-ca.pem',
|
||||
'verify_peer' => true,
|
||||
'verify_peer_name' => true,
|
||||
'peer_name' => 'bug69215-server',
|
||||
]]);
|
||||
|
||||
phpt_wait();
|
||||
|
||||
var_dump(stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx));
|
||||
CODE;
|
||||
|
||||
include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
resource(%d) of type (stream)
|
||||
|
||||
@@ -45,7 +45,7 @@ CODE;
|
||||
include 'ServerClientTestCase.inc';
|
||||
ServerClientTestCase::getInstance()->run($clientCode, $serverCode);
|
||||
--EXPECTF--
|
||||
Warning: stream_socket_client(): Peer fingerprint doesn't match in %s on line %d
|
||||
Warning: stream_socket_client(): peer_fingerprint match failure in %s on line %d
|
||||
|
||||
Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ var_dump(openssl_x509_parse($cert));
|
||||
var_dump(openssl_x509_parse($cert, false));
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(12) {
|
||||
array(15) {
|
||||
["name"]=>
|
||||
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
|
||||
["subject"]=>
|
||||
@@ -55,6 +55,12 @@ array(12) {
|
||||
int(1214821723)
|
||||
["validTo_time_t"]=>
|
||||
int(1217413723)
|
||||
["signatureTypeSN"]=>
|
||||
string(8) "RSA-SHA1"
|
||||
["signatureTypeLN"]=>
|
||||
string(21) "sha1WithRSAEncryption"
|
||||
["signatureTypeNID"]=>
|
||||
int(65)
|
||||
["purposes"]=>
|
||||
array(9) {
|
||||
[1]=>
|
||||
@@ -152,7 +158,7 @@ serial:AE:C5:56:CC:72:37:50:A2
|
||||
string(7) "CA:TRUE"
|
||||
}
|
||||
}
|
||||
array(12) {
|
||||
array(15) {
|
||||
["name"]=>
|
||||
string(96) "/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/emailAddress=hnangelo@php.net"
|
||||
["subject"]=>
|
||||
@@ -195,6 +201,12 @@ array(12) {
|
||||
int(1214821723)
|
||||
["validTo_time_t"]=>
|
||||
int(1217413723)
|
||||
["signatureTypeSN"]=>
|
||||
string(8) "RSA-SHA1"
|
||||
["signatureTypeLN"]=>
|
||||
string(21) "sha1WithRSAEncryption"
|
||||
["signatureTypeNID"]=>
|
||||
int(65)
|
||||
["purposes"]=>
|
||||
array(9) {
|
||||
[1]=>
|
||||
|
||||
+259
-99
@@ -78,6 +78,9 @@ extern php_stream* php_openssl_get_stream_from_ssl_handle(const SSL *ssl);
|
||||
extern int php_openssl_x509_fingerprint(X509 *peer, const char *method, zend_bool raw, char **out, int *out_len TSRMLS_DC);
|
||||
extern int php_openssl_get_ssl_stream_data_index();
|
||||
extern int php_openssl_get_x509_list_id(void);
|
||||
static struct timeval subtract_timeval( struct timeval a, struct timeval b );
|
||||
static int compare_timeval( struct timeval a, struct timeval b );
|
||||
static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, size_t count TSRMLS_DC);
|
||||
|
||||
php_stream_ops php_openssl_socket_ops;
|
||||
|
||||
@@ -272,7 +275,7 @@ static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *
|
||||
int result = -1;
|
||||
|
||||
if (php_openssl_x509_fingerprint(peer, method, 0, &fingerprint, &fingerprint_len TSRMLS_CC) == SUCCESS) {
|
||||
result = strcmp(expected, fingerprint);
|
||||
result = strcasecmp(expected, fingerprint);
|
||||
efree(fingerprint);
|
||||
}
|
||||
|
||||
@@ -295,6 +298,7 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
|
||||
}
|
||||
|
||||
return method && php_x509_fingerprint_cmp(peer, method, Z_STRVAL_P(val) TSRMLS_CC) == 0;
|
||||
|
||||
} else if (Z_TYPE_P(val) == IS_ARRAY) {
|
||||
HashPosition pos;
|
||||
zval **current;
|
||||
@@ -302,21 +306,33 @@ static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val TSRMLS_DC)
|
||||
uint key_len;
|
||||
ulong key_index;
|
||||
|
||||
if (!zend_hash_num_elements(Z_ARRVAL_P(val))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required");
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(val), &pos);
|
||||
zend_hash_get_current_data_ex(Z_ARRVAL_P(val), (void **)¤t, &pos) == SUCCESS;
|
||||
zend_hash_move_forward_ex(Z_ARRVAL_P(val), &pos)
|
||||
) {
|
||||
int key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(val), &key, &key_len, &key_index, 0, &pos);
|
||||
|
||||
if (key_type == HASH_KEY_IS_STRING
|
||||
&& Z_TYPE_PP(current) == IS_STRING
|
||||
&& php_x509_fingerprint_cmp(peer, key, Z_STRVAL_PP(current) TSRMLS_CC) != 0
|
||||
) {
|
||||
if (!(key_type == HASH_KEY_IS_STRING && Z_TYPE_PP(current) == IS_STRING)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid peer_fingerprint array; [algo => fingerprint] form required");
|
||||
return 0;
|
||||
}
|
||||
if (php_x509_fingerprint_cmp(peer, key, Z_STRVAL_PP(current) TSRMLS_CC) != 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,
|
||||
"Invalid peer_fingerprint value; fingerprint string or array of the form [algo => fingerprint] required");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -354,40 +370,57 @@ static zend_bool matches_wildcard_name(const char *subjectname, const char *cert
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_bool matches_san_list(X509 *peer, const char *subject_name TSRMLS_DC) /* {{{ */
|
||||
static zend_bool matches_san_list(X509 *peer, const char *subject_name) /* {{{ */
|
||||
{
|
||||
int i, san_name_len;
|
||||
zend_bool is_match = 0;
|
||||
int i, len;
|
||||
unsigned char *cert_name = NULL;
|
||||
char ipbuffer[64];
|
||||
|
||||
GENERAL_NAMES *alt_names = X509_get_ext_d2i(peer, NID_subject_alt_name, 0, 0);
|
||||
int alt_name_count = sk_GENERAL_NAME_num(alt_names);
|
||||
|
||||
for (i = 0; i < alt_name_count; i++) {
|
||||
GENERAL_NAME *san = sk_GENERAL_NAME_value(alt_names, i);
|
||||
if (san->type != GEN_DNS) {
|
||||
/* we only care about DNS names */
|
||||
continue;
|
||||
}
|
||||
|
||||
san_name_len = ASN1_STRING_length(san->d.dNSName);
|
||||
ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName);
|
||||
if (san->type == GEN_DNS) {
|
||||
ASN1_STRING_to_UTF8(&cert_name, san->d.dNSName);
|
||||
if (ASN1_STRING_length(san->d.dNSName) != strlen((const char*)cert_name)) {
|
||||
OPENSSL_free(cert_name);
|
||||
/* prevent null-byte poisoning*/
|
||||
continue;
|
||||
}
|
||||
|
||||
/* prevent null byte poisoning */
|
||||
if (san_name_len != strlen((const char*)cert_name)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer SAN entry is malformed");
|
||||
} else {
|
||||
is_match = matches_wildcard_name(subject_name, (const char *)cert_name);
|
||||
}
|
||||
/* accommodate valid FQDN entries ending in "." */
|
||||
len = strlen((const char*)cert_name);
|
||||
if (len && strcmp((const char *)&cert_name[len-1], ".") == 0) {
|
||||
cert_name[len-1] = '\0';
|
||||
}
|
||||
|
||||
OPENSSL_free(cert_name);
|
||||
|
||||
if (is_match) {
|
||||
break;
|
||||
if (matches_wildcard_name(subject_name, (const char *)cert_name)) {
|
||||
OPENSSL_free(cert_name);
|
||||
return 1;
|
||||
}
|
||||
OPENSSL_free(cert_name);
|
||||
} else if (san->type == GEN_IPADD) {
|
||||
if (san->d.iPAddress->length == 4) {
|
||||
sprintf(ipbuffer, "%d.%d.%d.%d",
|
||||
san->d.iPAddress->data[0],
|
||||
san->d.iPAddress->data[1],
|
||||
san->d.iPAddress->data[2],
|
||||
san->d.iPAddress->data[3]
|
||||
);
|
||||
if (strcasecmp(subject_name, (const char*)ipbuffer) == 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
/* No, we aren't bothering to check IPv6 addresses. Why?
|
||||
* Because IP SAN names are officially deprecated and are
|
||||
* not allowed by CAs starting in 2015. Deal with it.
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
return is_match;
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -436,7 +469,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
|
||||
? zend_is_true(*val)
|
||||
: sslsock->is_client;
|
||||
|
||||
must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(*val));
|
||||
must_verify_fingerprint = GET_VER_OPT("peer_fingerprint");
|
||||
|
||||
if ((must_verify_peer || must_verify_peer_name || must_verify_fingerprint) && peer == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate");
|
||||
@@ -471,7 +504,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
|
||||
if (Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_ARRAY) {
|
||||
if (!php_x509_fingerprint_match(peer, *val TSRMLS_CC)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,
|
||||
"Peer fingerprint doesn't match"
|
||||
"peer_fingerprint match failure"
|
||||
);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -479,6 +512,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,
|
||||
"Expected peer fingerprint must be a string or an array"
|
||||
);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,7 +532,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
|
||||
}
|
||||
|
||||
if (peer_name) {
|
||||
if (matches_san_list(peer, peer_name TSRMLS_CC)) {
|
||||
if (matches_san_list(peer, peer_name)) {
|
||||
return SUCCESS;
|
||||
} else if (matches_common_name(peer, peer_name TSRMLS_CC)) {
|
||||
return SUCCESS;
|
||||
@@ -783,16 +817,26 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
|
||||
zval **val = NULL;
|
||||
char *cafile = NULL;
|
||||
char *capath = NULL;
|
||||
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
|
||||
|
||||
GET_VER_OPT_STRING("cafile", cafile);
|
||||
GET_VER_OPT_STRING("capath", capath);
|
||||
|
||||
if (!cafile) {
|
||||
if (cafile == NULL) {
|
||||
cafile = zend_ini_string("openssl.cafile", sizeof("openssl.cafile"), 0);
|
||||
cafile = strlen(cafile) ? cafile : NULL;
|
||||
} else if (!sslsock->is_client) {
|
||||
/* Servers need to load and assign CA names from the cafile */
|
||||
STACK_OF(X509_NAME) *cert_names = SSL_load_client_CA_file(cafile);
|
||||
if (cert_names != NULL) {
|
||||
SSL_CTX_set_client_CA_list(ctx, cert_names);
|
||||
} else {
|
||||
php_error(E_WARNING, "SSL: failed loading CA names from cafile");
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!capath) {
|
||||
if (capath == NULL) {
|
||||
capath = zend_ini_string("openssl.capath", sizeof("openssl.capath"), 0);
|
||||
capath = strlen(capath) ? capath : NULL;
|
||||
}
|
||||
@@ -808,9 +852,6 @@ static int enable_peer_verification(SSL_CTX *ctx, php_stream *stream TSRMLS_DC)
|
||||
SSL_CTX_set_cert_verify_callback(ctx, win_cert_verify_callback, (void *)stream);
|
||||
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
|
||||
#else
|
||||
php_openssl_netstream_data_t *sslsock;
|
||||
sslsock = (php_openssl_netstream_data_t*)stream->abstract;
|
||||
|
||||
if (sslsock->is_client && !SSL_CTX_set_default_verify_paths(ctx)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,
|
||||
"Unable to set default verify locations and no CA settings specified");
|
||||
@@ -1679,16 +1720,9 @@ static int php_openssl_enable_crypto(php_stream *stream,
|
||||
|
||||
if (has_timeout) {
|
||||
gettimeofday(&cur_time, NULL);
|
||||
elapsed_time.tv_sec = cur_time.tv_sec - start_time.tv_sec;
|
||||
elapsed_time.tv_usec = cur_time.tv_usec - start_time.tv_usec;
|
||||
if (cur_time.tv_usec < start_time.tv_usec) {
|
||||
elapsed_time.tv_sec -= 1L;
|
||||
elapsed_time.tv_usec += 1000000L;
|
||||
}
|
||||
elapsed_time = subtract_timeval( cur_time, start_time );
|
||||
|
||||
if (elapsed_time.tv_sec > timeout->tv_sec ||
|
||||
(elapsed_time.tv_sec == timeout->tv_sec &&
|
||||
elapsed_time.tv_usec > timeout->tv_usec)) {
|
||||
if (compare_timeval( elapsed_time, *timeout) > 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL: Handshake timed out");
|
||||
return -1;
|
||||
}
|
||||
@@ -1704,12 +1738,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
|
||||
struct timeval left_time;
|
||||
|
||||
if (has_timeout) {
|
||||
left_time.tv_sec = timeout->tv_sec - elapsed_time.tv_sec;
|
||||
left_time.tv_usec = timeout->tv_usec - elapsed_time.tv_usec;
|
||||
if (timeout->tv_usec < elapsed_time.tv_usec) {
|
||||
left_time.tv_sec -= 1L;
|
||||
left_time.tv_usec += 1000000L;
|
||||
}
|
||||
left_time = subtract_timeval( *timeout, elapsed_time );
|
||||
}
|
||||
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_READ) ?
|
||||
(POLLIN|POLLPRI) : POLLOUT, has_timeout ? &left_time : NULL);
|
||||
@@ -1774,75 +1803,171 @@ static int php_openssl_enable_crypto(php_stream *stream,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
|
||||
static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)/* {{{ */
|
||||
{
|
||||
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
|
||||
int didwrite;
|
||||
|
||||
if (sslsock->ssl_active) {
|
||||
int retry = 1;
|
||||
|
||||
do {
|
||||
didwrite = SSL_write(sslsock->ssl_handle, buf, count);
|
||||
|
||||
if (didwrite <= 0) {
|
||||
retry = handle_ssl_error(stream, didwrite, 0 TSRMLS_CC);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} while(retry);
|
||||
|
||||
if (didwrite > 0) {
|
||||
php_stream_notify_progress_increment(stream->context, didwrite, 0);
|
||||
}
|
||||
} else {
|
||||
didwrite = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (didwrite < 0) {
|
||||
didwrite = 0;
|
||||
}
|
||||
|
||||
return didwrite;
|
||||
return php_openssl_sockop_io(1, stream, buf, count TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
|
||||
static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
return php_openssl_sockop_io(0, stream, (char*)buf, count TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/**
|
||||
* Factored out common functionality (blocking, timeout, loop management) for read and write.
|
||||
* Perform IO (read or write) to an SSL socket. If we have a timeout, we switch to non-blocking mode
|
||||
* for the duration of the operation, using select to do our waits. If we time out, or we have an error
|
||||
* report that back to PHP
|
||||
*
|
||||
*/
|
||||
static size_t php_openssl_sockop_io(int read, php_stream *stream, char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
|
||||
int nr_bytes = 0;
|
||||
|
||||
|
||||
/* Only do this if SSL is active. */
|
||||
if (sslsock->ssl_active) {
|
||||
int retry = 1;
|
||||
struct timeval start_time;
|
||||
struct timeval *timeout = NULL;
|
||||
int began_blocked = sslsock->s.is_blocked;
|
||||
int has_timeout = 0;
|
||||
|
||||
/* never use a timeout with non-blocking sockets */
|
||||
if (began_blocked && &sslsock->s.timeout) {
|
||||
timeout = &sslsock->s.timeout;
|
||||
}
|
||||
|
||||
if (timeout && php_set_sock_blocking(sslsock->s.socket, 0 TSRMLS_CC) == SUCCESS) {
|
||||
sslsock->s.is_blocked = 0;
|
||||
}
|
||||
|
||||
if (!sslsock->s.is_blocked && timeout && (timeout->tv_sec || timeout->tv_usec)) {
|
||||
has_timeout = 1;
|
||||
/* gettimeofday is not monotonic; using it here is not strictly correct */
|
||||
gettimeofday(&start_time, NULL);
|
||||
}
|
||||
|
||||
/* Main IO loop. */
|
||||
do {
|
||||
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
|
||||
struct timeval cur_time, elapsed_time, left_time;
|
||||
|
||||
/* If we have a timeout to check, figure out how much time has elapsed since we started. */
|
||||
if (has_timeout) {
|
||||
gettimeofday(&cur_time, NULL);
|
||||
|
||||
if (sslsock->reneg && sslsock->reneg->should_close) {
|
||||
/* renegotiation rate limiting triggered */
|
||||
php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR TSRMLS_CC);
|
||||
nr_bytes = 0;
|
||||
stream->eof = 1;
|
||||
break;
|
||||
} else if (nr_bytes <= 0) {
|
||||
retry = handle_ssl_error(stream, nr_bytes, 0 TSRMLS_CC);
|
||||
stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle));
|
||||
|
||||
} else {
|
||||
/* we got the data */
|
||||
break;
|
||||
/* Determine how much time we've taken so far. */
|
||||
elapsed_time = subtract_timeval(cur_time, start_time);
|
||||
|
||||
/* and return an error if we've taken too long. */
|
||||
if (compare_timeval(elapsed_time, *timeout) > 0 ) {
|
||||
/* If the socket was originally blocking, set it back. */
|
||||
if (began_blocked) {
|
||||
php_set_sock_blocking(sslsock->s.socket, 1 TSRMLS_CC);
|
||||
sslsock->s.is_blocked = 1;
|
||||
}
|
||||
sslsock->s.timeout_event = 1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now, do the IO operation. Don't block if we can't complete... */
|
||||
if (read) {
|
||||
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
|
||||
|
||||
if (sslsock->reneg && sslsock->reneg->should_close) {
|
||||
/* renegotiation rate limiting triggered */
|
||||
php_stream_xport_shutdown(stream, (stream_shutdown_t)SHUT_RDWR TSRMLS_CC);
|
||||
nr_bytes = 0;
|
||||
stream->eof = 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
nr_bytes = SSL_write(sslsock->ssl_handle, buf, count);
|
||||
}
|
||||
|
||||
/* Now, how much time until we time out? */
|
||||
if (has_timeout) {
|
||||
left_time = subtract_timeval( *timeout, elapsed_time );
|
||||
}
|
||||
|
||||
/* If we didn't do anything on the last loop (or an error) check to see if we should retry or exit. */
|
||||
if (nr_bytes <= 0) {
|
||||
|
||||
/* Get the error code from SSL, and check to see if it's an error or not. */
|
||||
int err = SSL_get_error(sslsock->ssl_handle, nr_bytes );
|
||||
retry = handle_ssl_error(stream, nr_bytes, 0 TSRMLS_CC);
|
||||
|
||||
/* If we get this (the above doesn't check) then we'll retry as well. */
|
||||
if (errno == EAGAIN && err == SSL_ERROR_WANT_READ && read) {
|
||||
retry = 1;
|
||||
}
|
||||
if (errno == EAGAIN && err == SSL_ERROR_WANT_WRITE && read == 0) {
|
||||
retry = 1;
|
||||
}
|
||||
|
||||
/* Also, on reads, we may get this condition on an EOF. We should check properly. */
|
||||
if (read) {
|
||||
stream->eof = (retry == 0 && errno != EAGAIN && !SSL_pending(sslsock->ssl_handle));
|
||||
}
|
||||
|
||||
/* Now, if we have to wait some time, and we're supposed to be blocking, wait for the socket to become
|
||||
* available. Now, php_pollfd_for uses select to wait up to our time_left value only...
|
||||
*/
|
||||
if (retry && began_blocked) {
|
||||
if (read) {
|
||||
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_WRITE) ?
|
||||
(POLLOUT|POLLPRI) : (POLLIN|POLLPRI), has_timeout ? &left_time : NULL);
|
||||
} else {
|
||||
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_READ) ?
|
||||
(POLLIN|POLLPRI) : (POLLOUT|POLLPRI), has_timeout ? &left_time : NULL);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Else, if we got bytes back, check for possible errors. */
|
||||
int err = SSL_get_error(sslsock->ssl_handle, nr_bytes);
|
||||
|
||||
/* If we didn't get any error, then let's return it to PHP. */
|
||||
if (err == SSL_ERROR_NONE)
|
||||
break;
|
||||
|
||||
/* Otherwise, we need to wait again (up to time_left or we get an error) */
|
||||
if (began_blocked) {
|
||||
if (read) {
|
||||
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_WRITE) ?
|
||||
(POLLOUT|POLLPRI) : (POLLIN|POLLPRI), has_timeout ? &left_time : NULL);
|
||||
} else {
|
||||
php_pollfd_for(sslsock->s.socket, (err == SSL_ERROR_WANT_READ) ?
|
||||
(POLLIN|POLLPRI) : (POLLOUT|POLLPRI), has_timeout ? &left_time : NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Finally, we keep going until we got data, and an SSL_ERROR_NONE, unless we had an error. */
|
||||
} while (retry);
|
||||
|
||||
/* Tell PHP if we read / wrote bytes. */
|
||||
if (nr_bytes > 0) {
|
||||
php_stream_notify_progress_increment(stream->context, nr_bytes, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC);
|
||||
|
||||
/* And if we were originally supposed to be blocking, let's reset the socket to that. */
|
||||
if (began_blocked && php_set_sock_blocking(sslsock->s.socket, 1 TSRMLS_CC) == SUCCESS) {
|
||||
sslsock->s.is_blocked = 1;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* This block is if we had no timeout... We will just sit and wait forever on the IO operation.
|
||||
*/
|
||||
if (read) {
|
||||
nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC);
|
||||
} else {
|
||||
nr_bytes = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
/* PHP doesn't expect a negative return. */
|
||||
if (nr_bytes < 0) {
|
||||
nr_bytes = 0;
|
||||
}
|
||||
@@ -1851,6 +1976,32 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
struct timeval subtract_timeval( struct timeval a, struct timeval b )
|
||||
{
|
||||
struct timeval difference;
|
||||
|
||||
difference.tv_sec = a.tv_sec - b.tv_sec;
|
||||
difference.tv_usec = a.tv_usec - b.tv_usec;
|
||||
|
||||
if (a.tv_usec < b.tv_usec) {
|
||||
b.tv_sec -= 1L;
|
||||
b.tv_usec += 1000000L;
|
||||
}
|
||||
|
||||
return difference;
|
||||
}
|
||||
|
||||
int compare_timeval( struct timeval a, struct timeval b )
|
||||
{
|
||||
if (a.tv_sec > b.tv_sec || (a.tv_sec == b.tv_sec && a.tv_usec > b.tv_usec) ) {
|
||||
return 1;
|
||||
} else if( a.tv_sec == b.tv_sec && a.tv_usec == b.tv_usec ) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
|
||||
@@ -2133,7 +2284,16 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS
|
||||
|
||||
case PHP_STREAM_AS_FD_FOR_SELECT:
|
||||
if (ret) {
|
||||
*(php_socket_t *)ret = sslsock->s.socket;
|
||||
size_t pending;
|
||||
if (stream->writepos == stream->readpos
|
||||
&& sslsock->ssl_active
|
||||
&& (pending = (size_t)SSL_pending(sslsock->ssl_handle)) > 0) {
|
||||
php_stream_fill_read_buffer(stream, pending < stream->chunk_size
|
||||
? pending
|
||||
: stream->chunk_size);
|
||||
}
|
||||
|
||||
*(int *)ret = sslsock->s.socket;
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
@@ -2168,7 +2328,7 @@ static long get_crypto_method(php_stream_context *ctx, long crypto_method)
|
||||
if (ctx && php_stream_context_get_option(ctx, "ssl", "crypto_method", &val) == SUCCESS) {
|
||||
convert_to_long_ex(val);
|
||||
crypto_method = (long)Z_LVAL_PP(val);
|
||||
crypto_method |= STREAM_CRYPTO_IS_CLIENT;
|
||||
crypto_method |= STREAM_CRYPTO_IS_CLIENT;
|
||||
}
|
||||
|
||||
return crypto_method;
|
||||
|
||||
@@ -3,6 +3,7 @@ PDO PgSQL Bug #66584 (Segmentation fault on statement deallocation)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
|
||||
if (!extension_loaded('json')) die('skip json ext not loaded');
|
||||
require dirname(__FILE__) . '/config.inc';
|
||||
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
||||
PDOTest::skip();
|
||||
|
||||
+10
-5
@@ -3114,7 +3114,7 @@ PHP_FUNCTION(pg_trace)
|
||||
php_stream *stream;
|
||||
id = PGG(default_link);
|
||||
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
|
||||
if (zend_parse_parameters(argc TSRMLS_CC, "p|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5722,9 +5722,6 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
|
||||
|
||||
regerr = regexec(&re, str, re.re_nsub+1, subs, 0);
|
||||
if (regerr == REG_NOMATCH) {
|
||||
#ifdef PHP_DEBUG
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex);
|
||||
#endif
|
||||
ret = FAILURE;
|
||||
}
|
||||
else if (regerr) {
|
||||
@@ -5971,7 +5968,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
|
||||
else {
|
||||
/* better regex? */
|
||||
if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$", 0 TSRMLS_CC) == FAILURE) {
|
||||
err = 1;
|
||||
if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^[+-]{0,1}(inf)(inity){0,1}$", 1 TSRMLS_CC) == FAILURE) {
|
||||
err = 1;
|
||||
} else {
|
||||
ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);
|
||||
php_pgsql_add_quotes(new_val, 1 TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1);
|
||||
@@ -6500,6 +6502,9 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c
|
||||
/* schame.table should be "schame"."table" */
|
||||
table_copy = estrdup(table);
|
||||
token = php_strtok_r(table_copy, ".", &tmp);
|
||||
if (token == NULL) {
|
||||
token = table;
|
||||
}
|
||||
len = strlen(token);
|
||||
if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) {
|
||||
smart_str_appendl(querystr, token, len);
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Bug #68638 pg_update() fails to store infinite values
|
||||
--SKIPIF--
|
||||
<?php include("skipif.inc"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
include('config.inc');
|
||||
|
||||
$conn = pg_connect($conn_str);
|
||||
|
||||
$table='test_68638';
|
||||
|
||||
pg_query("CREATE TABLE $table (id INT, value FLOAT)");
|
||||
|
||||
pg_insert($conn,$table, array('id' => 1, 'value' => 1.2));
|
||||
pg_insert($conn,$table, array('id' => 2, 'value' => 10));
|
||||
pg_insert($conn,$table, array('id' => 3, 'value' => 15));
|
||||
|
||||
var_dump(pg_update($conn,$table, array('value' => 'inf'), array('id' => 1), PGSQL_DML_STRING));
|
||||
|
||||
pg_update($conn,$table, array('value' => 'inf'), array('id' => 1));
|
||||
pg_update($conn,$table, array('value' => '-inf'), array('id' => 2));
|
||||
pg_update($conn,$table, array('value' => '+inf'), array('id' => 3));
|
||||
|
||||
$rs = pg_query("SELECT * FROM $table");
|
||||
while ($row = pg_fetch_assoc($rs)) {
|
||||
var_dump($row);
|
||||
}
|
||||
|
||||
pg_query("DROP TABLE $table");
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(52) "UPDATE "test_68638" SET "value"=E'inf' WHERE "id"=1;"
|
||||
array(2) {
|
||||
["id"]=>
|
||||
string(1) "1"
|
||||
["value"]=>
|
||||
string(8) "Infinity"
|
||||
}
|
||||
array(2) {
|
||||
["id"]=>
|
||||
string(1) "2"
|
||||
["value"]=>
|
||||
string(9) "-Infinity"
|
||||
}
|
||||
array(2) {
|
||||
["id"]=>
|
||||
string(1) "3"
|
||||
["value"]=>
|
||||
string(8) "Infinity"
|
||||
}
|
||||
+38
-41
@@ -598,52 +598,41 @@ int phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len
|
||||
*
|
||||
* Meta-data is in this format:
|
||||
* [len32][data...]
|
||||
*
|
||||
*
|
||||
* data is the serialized zval
|
||||
*/
|
||||
int phar_parse_metadata(char **buffer, zval **metadata, int zip_metadata_len TSRMLS_DC) /* {{{ */
|
||||
int phar_parse_metadata(char **buffer, zval **metadata, php_uint32 zip_metadata_len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
const unsigned char *p;
|
||||
php_uint32 buf_len;
|
||||
php_unserialize_data_t var_hash;
|
||||
|
||||
if (!zip_metadata_len) {
|
||||
PHAR_GET_32(*buffer, buf_len);
|
||||
} else {
|
||||
buf_len = zip_metadata_len;
|
||||
}
|
||||
|
||||
if (buf_len) {
|
||||
if (zip_metadata_len) {
|
||||
const unsigned char *p, *p_buff = estrndup(*buffer, zip_metadata_len);
|
||||
p = p_buff;
|
||||
ALLOC_ZVAL(*metadata);
|
||||
INIT_ZVAL(**metadata);
|
||||
p = (const unsigned char*) *buffer;
|
||||
PHP_VAR_UNSERIALIZE_INIT(var_hash);
|
||||
|
||||
if (!php_var_unserialize(metadata, &p, p + buf_len, &var_hash TSRMLS_CC)) {
|
||||
if (!php_var_unserialize(metadata, &p, p + zip_metadata_len, &var_hash TSRMLS_CC)) {
|
||||
efree(p_buff);
|
||||
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
||||
zval_ptr_dtor(metadata);
|
||||
*metadata = NULL;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
efree(p_buff);
|
||||
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
|
||||
|
||||
if (PHAR_G(persist)) {
|
||||
/* lazy init metadata */
|
||||
zval_ptr_dtor(metadata);
|
||||
*metadata = (zval *) pemalloc(buf_len, 1);
|
||||
memcpy(*metadata, *buffer, buf_len);
|
||||
*buffer += buf_len;
|
||||
*metadata = (zval *) pemalloc(zip_metadata_len, 1);
|
||||
memcpy(*metadata, *buffer, zip_metadata_len);
|
||||
return SUCCESS;
|
||||
}
|
||||
} else {
|
||||
*metadata = NULL;
|
||||
}
|
||||
|
||||
if (!zip_metadata_len) {
|
||||
*buffer += buf_len;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}}*/
|
||||
@@ -653,7 +642,7 @@ int phar_parse_metadata(char **buffer, zval **metadata, int zip_metadata_len TSR
|
||||
*
|
||||
* Parse a new one and add it to the cache, returning either SUCCESS or
|
||||
* FAILURE, and setting pphar to the pointer to the manifest entry
|
||||
*
|
||||
*
|
||||
* This is used by phar_open_from_filename to process the manifest, but can be called
|
||||
* directly.
|
||||
*/
|
||||
@@ -664,6 +653,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
|
||||
phar_entry_info entry;
|
||||
php_uint32 manifest_len, manifest_count, manifest_flags, manifest_index, tmp_len, sig_flags;
|
||||
php_uint16 manifest_ver;
|
||||
php_uint32 len;
|
||||
long offset;
|
||||
int sig_len, register_alias = 0, temp_alias = 0;
|
||||
char *signature = NULL;
|
||||
@@ -1029,16 +1019,21 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
|
||||
mydata->is_persistent = PHAR_G(persist);
|
||||
|
||||
/* check whether we have meta data, zero check works regardless of byte order */
|
||||
PHAR_GET_32(buffer, len);
|
||||
if (mydata->is_persistent) {
|
||||
PHAR_GET_32(buffer, mydata->metadata_len);
|
||||
if (phar_parse_metadata(&buffer, &mydata->metadata, mydata->metadata_len TSRMLS_CC) == FAILURE) {
|
||||
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
|
||||
}
|
||||
} else {
|
||||
if (phar_parse_metadata(&buffer, &mydata->metadata, 0 TSRMLS_CC) == FAILURE) {
|
||||
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
|
||||
mydata->metadata_len = len;
|
||||
if(!len) {
|
||||
/* FIXME: not sure why this is needed but removing it breaks tests */
|
||||
PHAR_GET_32(buffer, len);
|
||||
}
|
||||
}
|
||||
if(len > endbuffer - buffer) {
|
||||
MAPPHAR_FAIL("internal corruption of phar \"%s\" (trying to read past buffer end)");
|
||||
}
|
||||
if (phar_parse_metadata(&buffer, &mydata->metadata, len TSRMLS_CC) == FAILURE) {
|
||||
MAPPHAR_FAIL("unable to read phar metadata in .phar file \"%s\"");
|
||||
}
|
||||
buffer += len;
|
||||
|
||||
/* set up our manifest */
|
||||
zend_hash_init(&mydata->manifest, manifest_count,
|
||||
@@ -1073,7 +1068,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
|
||||
entry.manifest_pos = manifest_index;
|
||||
}
|
||||
|
||||
if (buffer + entry.filename_len + 20 > endbuffer) {
|
||||
if (entry.filename_len + 20 > endbuffer - buffer) {
|
||||
MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
|
||||
}
|
||||
|
||||
@@ -1109,19 +1104,21 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
|
||||
entry.flags |= PHAR_ENT_PERM_DEF_DIR;
|
||||
}
|
||||
|
||||
PHAR_GET_32(buffer, len);
|
||||
if (entry.is_persistent) {
|
||||
PHAR_GET_32(buffer, entry.metadata_len);
|
||||
if (!entry.metadata_len) buffer -= 4;
|
||||
if (phar_parse_metadata(&buffer, &entry.metadata, entry.metadata_len TSRMLS_CC) == FAILURE) {
|
||||
pefree(entry.filename, entry.is_persistent);
|
||||
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
|
||||
}
|
||||
entry.metadata_len = len;
|
||||
} else {
|
||||
if (phar_parse_metadata(&buffer, &entry.metadata, 0 TSRMLS_CC) == FAILURE) {
|
||||
pefree(entry.filename, entry.is_persistent);
|
||||
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
|
||||
}
|
||||
entry.metadata_len = 0;
|
||||
}
|
||||
if (len > endbuffer - buffer) {
|
||||
pefree(entry.filename, entry.is_persistent);
|
||||
MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
|
||||
}
|
||||
if (phar_parse_metadata(&buffer, &entry.metadata, len TSRMLS_CC) == FAILURE) {
|
||||
pefree(entry.filename, entry.is_persistent);
|
||||
MAPPHAR_FAIL("unable to read file metadata in .phar file \"%s\"");
|
||||
}
|
||||
buffer += len;
|
||||
|
||||
entry.offset = entry.offset_abs = offset;
|
||||
offset += entry.compressed_filesize;
|
||||
@@ -2217,7 +2214,7 @@ last_time:
|
||||
|
||||
/**
|
||||
* Process a phar stream name, ensuring we can handle any of:
|
||||
*
|
||||
*
|
||||
* - whatever.phar
|
||||
* - whatever.phar.gz
|
||||
* - whatever.phar.bz2
|
||||
|
||||
@@ -397,7 +397,7 @@ class PharCommand extends CLICommand
|
||||
*/
|
||||
static function cli_arg_typ_privkey($arg, $cfg, $key)
|
||||
{
|
||||
$arg = self::cli_arg_typ_string($arg, $cfg, $key);
|
||||
$arg = self::cli_arg_typ_filecont($arg, $cfg, $key);
|
||||
|
||||
$hash_avail = Phar::getSupportedSignatures();
|
||||
if ($arg && !in_array('OpenSSL', $hash_avail))
|
||||
|
||||
@@ -124,6 +124,8 @@
|
||||
#define TAR_SYMLINK '2'
|
||||
#define TAR_DIR '5'
|
||||
#define TAR_NEW '8'
|
||||
#define TAR_GLOBAL_HDR 'g'
|
||||
#define TAR_FILE_HDR 'x'
|
||||
|
||||
#define PHAR_MUNG_PHP_SELF (1<<0)
|
||||
#define PHAR_MUNG_REQUEST_URI (1<<1)
|
||||
@@ -534,10 +536,13 @@ static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
char tmp[MAXPATHLEN];
|
||||
int tmp_len;
|
||||
size_t len;
|
||||
|
||||
tmp_len = entry->filename_len + entry->phar->fname_len;
|
||||
memcpy(tmp, entry->phar->fname, entry->phar->fname_len);
|
||||
memcpy(tmp + entry->phar->fname_len, entry->filename, entry->filename_len);
|
||||
tmp_len = MIN(MAXPATHLEN, entry->filename_len + entry->phar->fname_len);
|
||||
len = MIN(entry->phar->fname_len, tmp_len);
|
||||
memcpy(tmp, entry->phar->fname, len);
|
||||
len = MIN(tmp_len - len, entry->filename_len);
|
||||
memcpy(tmp + entry->phar->fname_len, entry->filename, len);
|
||||
entry->inode = (unsigned short)zend_get_hash_value(tmp, tmp_len);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -570,7 +575,7 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
|
||||
char *phar_find_in_include_path(char *file, int file_len, phar_archive_data **pphar TSRMLS_DC);
|
||||
char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC);
|
||||
phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error TSRMLS_DC);
|
||||
int phar_parse_metadata(char **buffer, zval **metadata, int zip_metadata_len TSRMLS_DC);
|
||||
int phar_parse_metadata(char **buffer, zval **metadata, php_uint32 zip_metadata_len TSRMLS_DC);
|
||||
void destroy_phar_manifest_entry(void *pDest);
|
||||
int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t position, int follow_links TSRMLS_DC);
|
||||
php_stream *phar_get_efp(phar_entry_info *entry, int follow_links TSRMLS_DC);
|
||||
|
||||
@@ -3624,7 +3624,7 @@ static void phar_add_file(phar_archive_data **pphar, char *filename, int filenam
|
||||
phar_entry_data *data;
|
||||
php_stream *contents_file;
|
||||
|
||||
if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1)) {
|
||||
if (filename_len >= sizeof(".phar")-1 && !memcmp(filename, ".phar", sizeof(".phar")-1) && (filename[5] == '/' || filename[5] == '\\' || filename[5] == '\0')) {
|
||||
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Cannot create any files in magic \".phar\" directory", (*pphar)->fname);
|
||||
return;
|
||||
}
|
||||
|
||||
+12
-2
@@ -102,7 +102,7 @@ int phar_is_tar(char *buf, char *fname) /* {{{ */
|
||||
tar_header *header = (tar_header *) buf;
|
||||
php_uint32 checksum = phar_tar_number(header->checksum, sizeof(header->checksum));
|
||||
php_uint32 ret;
|
||||
char save[sizeof(header->checksum)];
|
||||
char save[sizeof(header->checksum)], *bname;
|
||||
|
||||
/* assume that the first filename in a tar won't begin with <?php */
|
||||
if (!strncmp(buf, "<?php", sizeof("<?php")-1)) {
|
||||
@@ -113,7 +113,10 @@ int phar_is_tar(char *buf, char *fname) /* {{{ */
|
||||
memset(header->checksum, ' ', sizeof(header->checksum));
|
||||
ret = (checksum == phar_tar_checksum(buf, 512));
|
||||
memcpy(header->checksum, save, sizeof(header->checksum));
|
||||
if (!ret && strstr(fname, ".tar")) {
|
||||
if ((bname = strrchr(fname, PHP_DIR_SEPARATOR))) {
|
||||
fname = bname;
|
||||
}
|
||||
if (!ret && (bname = strstr(fname, ".tar")) && (bname[4] == '\0' || bname[4] == '.')) {
|
||||
/* probably a corrupted tar - so we will pretend it is one */
|
||||
return 1;
|
||||
}
|
||||
@@ -255,6 +258,12 @@ int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias,
|
||||
size = entry.uncompressed_filesize = entry.compressed_filesize =
|
||||
phar_tar_number(hdr->size, sizeof(hdr->size));
|
||||
|
||||
/* skip global/file headers (pax) */
|
||||
if (!old && (hdr->typeflag == TAR_GLOBAL_HDR || hdr->typeflag == TAR_FILE_HDR)) {
|
||||
size = (size+511)&~511;
|
||||
goto next;
|
||||
}
|
||||
|
||||
if (((!old && hdr->prefix[0] == 0) || old) && strlen(hdr->name) == sizeof(".phar/signature.bin")-1 && !strncmp(hdr->name, ".phar/signature.bin", sizeof(".phar/signature.bin")-1)) {
|
||||
off_t curloc;
|
||||
|
||||
@@ -548,6 +557,7 @@ bail:
|
||||
size = (size+511)&~511;
|
||||
|
||||
if (((hdr->typeflag == '\0') || (hdr->typeflag == TAR_FILE)) && size > 0) {
|
||||
next:
|
||||
/* this is not good enough - seek succeeds even on truncated tars */
|
||||
php_stream_seek(fp, size, SEEK_CUR);
|
||||
if ((uint)php_stream_tell(fp) > totalsize) {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
--TEST--
|
||||
Bug #64931 (phar_add_file is too restrictive on filename)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded("phar") or die("skip need ext/phar support"); ?>
|
||||
--INI--
|
||||
phar.readonly=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
echo "Test\n";
|
||||
|
||||
@unlink(__DIR__."/bug64931.phar");
|
||||
$phar = new Phar(__DIR__."/bug64931.phar");
|
||||
$phar->addFile(__DIR__."/src/.pharignore", ".pharignore");
|
||||
try {
|
||||
$phar->addFile(__DIR__."/src/.pharignore", ".phar/gotcha");
|
||||
} catch (Exception $e) {
|
||||
echo "CAUGHT: ". $e->getMessage() ."\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$phar->addFromString(".phar", "gotcha");
|
||||
} catch (Exception $e) {
|
||||
echo "CAUGHT: ". $e->getMessage() ."\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$phar->addFromString(".phar//", "gotcha");
|
||||
} catch (Exception $e) {
|
||||
echo "CAUGHT: ". $e->getMessage() ."\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$phar->addFromString(".phar\\", "gotcha");
|
||||
} catch (Exception $e) {
|
||||
echo "CAUGHT: ". $e->getMessage() ."\n";
|
||||
}
|
||||
|
||||
try {
|
||||
$phar->addFromString(".phar\0", "gotcha");
|
||||
} catch (Exception $e) {
|
||||
echo "CAUGHT: ". $e->getMessage() ."\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__."/bug64931.phar");
|
||||
?>
|
||||
--EXPECT--
|
||||
Test
|
||||
CAUGHT: Cannot create any files in magic ".phar" directory
|
||||
CAUGHT: Cannot create any files in magic ".phar" directory
|
||||
CAUGHT: Cannot create any files in magic ".phar" directory
|
||||
CAUGHT: Cannot create any files in magic ".phar" directory
|
||||
CAUGHT: Cannot create any files in magic ".phar" directory
|
||||
===DONE===
|
||||
Loaded 100 of 201 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user