mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-10 18:50:50 +00:00
Compare commits
482
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8889b13853 | ||
|
|
e0e2323e7d | ||
|
|
91641c23fc | ||
|
|
e8f76d10ab | ||
|
|
be6b7e5eeb | ||
|
|
9f14920725 | ||
|
|
753e6eacd5 | ||
|
|
5f9df47ea8 | ||
|
|
c4d35c3214 | ||
|
|
c9d3ff0c6e | ||
|
|
9fe0398dad | ||
|
|
14d674442e | ||
|
|
dd7bea17bf | ||
|
|
99613431b4 | ||
|
|
029f8e8777 | ||
|
|
1f67b4c24d | ||
|
|
e87ac688d5 | ||
|
|
e5940aa795 | ||
|
|
1d32b80903 | ||
|
|
8a442a33c3 | ||
|
|
1666e80cb9 | ||
|
|
293dd3d701 | ||
|
|
f67ccd4a7b | ||
|
|
a952aac6a7 | ||
|
|
5c458c9b02 | ||
|
|
7c412688f4 | ||
|
|
7ab39e2fae | ||
|
|
3b48c5a36f | ||
|
|
1693eb9d2a | ||
|
|
ced2a80e6f | ||
|
|
573568bbce | ||
|
|
c301adbbd1 | ||
|
|
95190db84d | ||
|
|
6e886f07a8 | ||
|
|
81c25abd25 | ||
|
|
805dc0ea47 | ||
|
|
ee6900c3de | ||
|
|
a621023168 | ||
|
|
56cdaecb28 | ||
|
|
18a37eeeec | ||
|
|
d276e6a838 | ||
|
|
c7a4e37d97 | ||
|
|
0ae8c337a3 | ||
|
|
bf37b97d9c | ||
|
|
30a5ed3a79 | ||
|
|
1b681880c1 | ||
|
|
ed16f2fed5 | ||
|
|
266c62070f | ||
|
|
e0294b39e3 | ||
|
|
12628e9a46 | ||
|
|
c52322707e | ||
|
|
6e8b2d21d1 | ||
|
|
40afd77826 | ||
|
|
315c0536c2 | ||
|
|
5513f00a97 | ||
|
|
23c359c276 | ||
|
|
cc125f277b | ||
|
|
0d2c4f822c | ||
|
|
cce457c68c | ||
|
|
6714f73545 | ||
|
|
074b86d845 | ||
|
|
2597f5d665 | ||
|
|
4c2e1a13be | ||
|
|
31ed322b06 | ||
|
|
24d8f6ed7c | ||
|
|
2fba646837 | ||
|
|
b1d36cb820 | ||
|
|
ccf39dd552 | ||
|
|
64e3e932fc | ||
|
|
f5e56cf970 | ||
|
|
9a4c9348b1 | ||
|
|
0c34d515f1 | ||
|
|
3f842655db | ||
|
|
72ac8cf5ad | ||
|
|
27dd8048b7 | ||
|
|
0f9bf85ad9 | ||
|
|
6ed7136371 | ||
|
|
138fea83fe | ||
|
|
305bddb0ed | ||
|
|
4db4997ac5 | ||
|
|
d28f1dae9d | ||
|
|
ad96a052d9 | ||
|
|
da3995852e | ||
|
|
8eb94b6e32 | ||
|
|
9cd23ff84f | ||
|
|
aecc435482 | ||
|
|
04b42b1e05 | ||
|
|
2194690625 | ||
|
|
958fa34c16 | ||
|
|
80fee637f4 | ||
|
|
2c0a18480d | ||
|
|
88838dd282 | ||
|
|
03ccd42b18 | ||
|
|
9fbd0c1ff1 | ||
|
|
5056d59f96 | ||
|
|
2c16b9cf62 | ||
|
|
6046acf93e | ||
|
|
f12fd5c2d3 | ||
|
|
65abdb556d | ||
|
|
7d77289717 | ||
|
|
4fc1bfa93b | ||
|
|
6929121423 | ||
|
|
9a2207c90a | ||
|
|
6b116932b2 | ||
|
|
9622f973a5 | ||
|
|
fb4a6dc0f1 | ||
|
|
4472f9e822 | ||
|
|
f2c2a4be9e | ||
|
|
7e2c3a77c0 | ||
|
|
f813f43855 | ||
|
|
a2a122804e | ||
|
|
4a643e5e13 | ||
|
|
7e1843fc04 | ||
|
|
e7168519dd | ||
|
|
8b191921c3 | ||
|
|
027a82e4e6 | ||
|
|
c9f21e8319 | ||
|
|
462a9aa190 | ||
|
|
b57a38f584 | ||
|
|
90c26fb6b1 | ||
|
|
e4af29b0b7 | ||
|
|
9ebc96116b | ||
|
|
1dafa806a9 | ||
|
|
18ba78e988 | ||
|
|
cbbe17fb53 | ||
|
|
97c0b133c5 | ||
|
|
3c3b8c8365 | ||
|
|
df5ee7bc25 | ||
|
|
17a53f9e60 | ||
|
|
8ebdb1f5fd | ||
|
|
ec97e78a8d | ||
|
|
1eb13c5204 | ||
|
|
e8b768dd92 | ||
|
|
9cc0a5a9a9 | ||
|
|
d42ce593ff | ||
|
|
206d45bc17 | ||
|
|
8466155ff5 | ||
|
|
828f911efd | ||
|
|
374ae8e9da | ||
|
|
8e0594a944 | ||
|
|
6571a90f7f | ||
|
|
bd1919504b | ||
|
|
77a71cba20 | ||
|
|
b25009fc2c | ||
|
|
2767d1953f | ||
|
|
1d69028d2f | ||
|
|
834f7a39be | ||
|
|
dbbfb23c62 | ||
|
|
1e9273c48b | ||
|
|
48e76abadd | ||
|
|
f1ea7d195a | ||
|
|
caa96c4416 | ||
|
|
894df05fe8 | ||
|
|
7521149193 | ||
|
|
bc8c722cb4 | ||
|
|
df09515089 | ||
|
|
9698082306 | ||
|
|
f69362d212 | ||
|
|
47d6ea6332 | ||
|
|
b00f8f2a5b | ||
|
|
e9a58bee24 | ||
|
|
4d0565b5ba | ||
|
|
1a88692692 | ||
|
|
f0a17b3a86 | ||
|
|
905310d144 | ||
|
|
9bb5f64871 | ||
|
|
8dc5ffa479 | ||
|
|
928aecc002 | ||
|
|
7b1572b177 | ||
|
|
05e8a0febe | ||
|
|
b61bd1243a | ||
|
|
33c1a55b40 | ||
|
|
2fbce5f51f | ||
|
|
740661bd7a | ||
|
|
511f07b747 | ||
|
|
0fbcff1b35 | ||
|
|
08ac37bd2a | ||
|
|
1364742be9 | ||
|
|
41131cd41d | ||
|
|
5faa15c4ce | ||
|
|
f3feddb5b4 | ||
|
|
e6c48213c2 | ||
|
|
d565d4bc1c | ||
|
|
3c3980caa1 | ||
|
|
6cb75fb1e8 | ||
|
|
d1a491acf3 | ||
|
|
e4d55878dd | ||
|
|
eebcbd5de3 | ||
|
|
31cbe23a9a | ||
|
|
171c759d79 | ||
|
|
190fbb94e7 | ||
|
|
3666cfab97 | ||
|
|
b01b093ca9 | ||
|
|
a4aa4f9772 | ||
|
|
0b0e7520a9 | ||
|
|
a50a5c1bf1 | ||
|
|
99a5170781 | ||
|
|
1c84b55ade | ||
|
|
d67e92af8a | ||
|
|
d4b455ae3f | ||
|
|
d0c98366d0 | ||
|
|
fe1d6feb3d | ||
|
|
a26748d7be | ||
|
|
411eee7b5a | ||
|
|
00047fcf84 | ||
|
|
587668be56 | ||
|
|
c3804a2cf9 | ||
|
|
d1f82bfeb2 | ||
|
|
82ce2a4e4d | ||
|
|
5063b5aea1 | ||
|
|
5829458215 | ||
|
|
8bb3bd04a9 | ||
|
|
9d3b729803 | ||
|
|
131117f7a5 | ||
|
|
0f182c2495 | ||
|
|
f80bb059b3 | ||
|
|
8c5b27e061 | ||
|
|
61a2566dc9 | ||
|
|
3cc4265527 | ||
|
|
57c9983619 | ||
|
|
eb190b4e91 | ||
|
|
3798eb6fd5 | ||
|
|
3810e7b362 | ||
|
|
2ca8d85dd4 | ||
|
|
aa82e99ed8 | ||
|
|
81406c0c1d | ||
|
|
0218acb7e7 | ||
|
|
a099545bec | ||
|
|
aca4f65c7e | ||
|
|
7ed028b108 | ||
|
|
28e2f749e4 | ||
|
|
b512f4a956 | ||
|
|
8129b83992 | ||
|
|
be77ce37fd | ||
|
|
3e6e590784 | ||
|
|
6173488110 | ||
|
|
152d53c844 | ||
|
|
1896ca4e88 | ||
|
|
822498128b | ||
|
|
5cce0d7c7c | ||
|
|
c96a9ca6f5 | ||
|
|
642e44b98f | ||
|
|
3e8dbb3e5d | ||
|
|
5fbcc2b90f | ||
|
|
76e249d31c | ||
|
|
aabca89f95 | ||
|
|
acc58f1845 | ||
|
|
ca08ed417e | ||
|
|
ec28576260 | ||
|
|
17d4f5c2f8 | ||
|
|
15336b44d9 | ||
|
|
932191a6ed | ||
|
|
3c356aa7cb | ||
|
|
403f23b460 | ||
|
|
fb49f137ec | ||
|
|
a8566ee800 | ||
|
|
d2d17e14ee | ||
|
|
f5ccd71d0c | ||
|
|
f71fcf8bdd | ||
|
|
7903276f4c | ||
|
|
42902919bc | ||
|
|
90e11e0c13 | ||
|
|
23d4c9e6c7 | ||
|
|
966311e627 | ||
|
|
fc2c301fe2 | ||
|
|
2552cf248d | ||
|
|
9dd5d96332 | ||
|
|
7759d6b0db | ||
|
|
6a5e1783b7 | ||
|
|
a19655cfe3 | ||
|
|
98b9dfaec9 | ||
|
|
4d677ae0e2 | ||
|
|
11d74b5b79 | ||
|
|
219ebcb689 | ||
|
|
6725863993 | ||
|
|
13a5c54068 | ||
|
|
51d19891a4 | ||
|
|
6fc7817558 | ||
|
|
8db64e919c | ||
|
|
bdf1b22da5 | ||
|
|
82637e8187 | ||
|
|
a8df121e18 | ||
|
|
87fe485c35 | ||
|
|
1071a2655f | ||
|
|
78d5783b62 | ||
|
|
0be13d2dc2 | ||
|
|
51b584b159 | ||
|
|
7377f45b61 | ||
|
|
7ae00f08cf | ||
|
|
99d6e09c3d | ||
|
|
76a143c27c | ||
|
|
bfc42211d3 | ||
|
|
fae6407314 | ||
|
|
8b905e337c | ||
|
|
3580b9f8b6 | ||
|
|
2b7cd813e7 | ||
|
|
0ca1698cf9 | ||
|
|
06b6cb0ab0 | ||
|
|
3104759915 | ||
|
|
0259459486 | ||
|
|
c1ac081bf1 | ||
|
|
b9c9be13cc | ||
|
|
ef6f163161 | ||
|
|
c65de8ac13 | ||
|
|
ea640e6117 | ||
|
|
c1280db28a | ||
|
|
a4e140e6ab | ||
|
|
7008a36627 | ||
|
|
884db2f7be | ||
|
|
b63d41e1e5 | ||
|
|
ff7c981d19 | ||
|
|
869604eefb | ||
|
|
c015095042 | ||
|
|
4c24f170ea | ||
|
|
f22bc6438d | ||
|
|
8bd8a64db6 | ||
|
|
4576c41291 | ||
|
|
8a555d7c66 | ||
|
|
08777e9615 | ||
|
|
adf0920065 | ||
|
|
e1ba58f068 | ||
|
|
a66cae883b | ||
|
|
2ed986d3c8 | ||
|
|
ac56700125 | ||
|
|
a4a34c2c0b | ||
|
|
7b2c22696a | ||
|
|
60fc27f912 | ||
|
|
717a043a32 | ||
|
|
50433f708e | ||
|
|
9a9ede00bc | ||
|
|
f6aaaf02a9 | ||
|
|
612aff3a8a | ||
|
|
b90c2fc7b9 | ||
|
|
8b229bfeeb | ||
|
|
ea9da7529c | ||
|
|
6744737577 | ||
|
|
c9fa39da5e | ||
|
|
3455848dfe | ||
|
|
9b8f1d6037 | ||
|
|
fafe01b07b | ||
|
|
76370f30db | ||
|
|
ce7e180a04 | ||
|
|
de7a6b1232 | ||
|
|
86732b4ea0 | ||
|
|
c73a2f7f45 | ||
|
|
ec82c6b4e1 | ||
|
|
b8487b6a7d | ||
|
|
25bd11cf27 | ||
|
|
b5fc4dbf21 | ||
|
|
0f03224d59 | ||
|
|
1314db7109 | ||
|
|
57940605da | ||
|
|
cab1c3b370 | ||
|
|
ad32c7b538 | ||
|
|
d826bdf1c7 | ||
|
|
b4873e57b4 | ||
|
|
6bd527771c | ||
|
|
02c24be8e4 | ||
|
|
0183a9af5a | ||
|
|
53de1c2830 | ||
|
|
056c2ce349 | ||
|
|
bd74e7d013 | ||
|
|
f90c832cb2 | ||
|
|
4edbac6ec5 | ||
|
|
e453904251 | ||
|
|
3c84e5e1ce | ||
|
|
c196f9cdf7 | ||
|
|
4638ba9c07 | ||
|
|
98f6248dcf | ||
|
|
de1c407348 | ||
|
|
63d5e21f42 | ||
|
|
ba980d0a62 | ||
|
|
ed10168b30 | ||
|
|
1d5a4520be | ||
|
|
e3bd360ec9 | ||
|
|
5a9f0c77ad | ||
|
|
7002c32809 | ||
|
|
a00350486f | ||
|
|
9a9249a8d0 | ||
|
|
e6cc30e167 | ||
|
|
e8f2315a00 | ||
|
|
757105e2a2 | ||
|
|
155619184f | ||
|
|
c5d9c50897 | ||
|
|
69fd1133d0 | ||
|
|
722ed4c757 | ||
|
|
6d7500c14c | ||
|
|
2af71a04b0 | ||
|
|
fd93c8601d | ||
|
|
0c7250f260 | ||
|
|
7c389e8429 | ||
|
|
5b90a8bd7c | ||
|
|
8705254f2d | ||
|
|
2a65544f78 | ||
|
|
fc0b0afdc3 | ||
|
|
2af6dded37 | ||
|
|
c9b24ef307 | ||
|
|
7dde353ee7 | ||
|
|
c395c6e5d7 | ||
|
|
b028cacf31 | ||
|
|
e1d2f86a41 | ||
|
|
5f107ab8a6 | ||
|
|
7f428cae88 | ||
|
|
6c5211a0ce | ||
|
|
f6aef68089 | ||
|
|
3f627e580a | ||
|
|
d002037dc1 | ||
|
|
1b4570b79f | ||
|
|
4cde87b5b6 | ||
|
|
5cc924e5c2 | ||
|
|
b3f3cd5903 | ||
|
|
4b4275059f | ||
|
|
0925e7239d | ||
|
|
58797ab895 | ||
|
|
8c0133f0eb | ||
|
|
42b2d7fec5 | ||
|
|
b9ec171e7d | ||
|
|
5b597a2e5b | ||
|
|
af2c332f41 | ||
|
|
6b83832cf4 | ||
|
|
c4c1993af6 | ||
|
|
e9ac8954be | ||
|
|
7722455726 | ||
|
|
cc64702796 | ||
|
|
eb456d2d27 | ||
|
|
ed0ec66996 | ||
|
|
958f18c1a1 | ||
|
|
307e546e1a | ||
|
|
0c34f53c93 | ||
|
|
84948e6382 | ||
|
|
cc8ffa6911 | ||
|
|
12230c66b1 | ||
|
|
5f4113edb3 | ||
|
|
60feda4ea4 | ||
|
|
8aa511f1fc | ||
|
|
7245bff300 | ||
|
|
88746d60ab | ||
|
|
8267a5fba7 | ||
|
|
76ec139a0a | ||
|
|
e0e83c0180 | ||
|
|
020541587a | ||
|
|
a1db72d519 | ||
|
|
fffa1aa0f3 | ||
|
|
c3fc4194ea | ||
|
|
999a3553d5 | ||
|
|
93f7939891 | ||
|
|
248fdfcf73 | ||
|
|
49b1290617 | ||
|
|
1ab5a1b432 | ||
|
|
79fc877290 | ||
|
|
4c968c6ddd | ||
|
|
489fd56fe3 | ||
|
|
3d56418722 | ||
|
|
d1ab974f0b | ||
|
|
d3bdbe6395 | ||
|
|
a44c89e8af | ||
|
|
93e8f59aab | ||
|
|
6f73079ce1 | ||
|
|
f96ebb0986 | ||
|
|
d144590d38 | ||
|
|
a2f4c32eb1 | ||
|
|
0e2447cd11 | ||
|
|
54310d95f9 | ||
|
|
4056edd20d | ||
|
|
5d57e25579 | ||
|
|
07a793810f | ||
|
|
1f7cc24df7 | ||
|
|
bfcf32237e | ||
|
|
0307315769 | ||
|
|
65b6950a56 | ||
|
|
c26097c2f1 | ||
|
|
84dce33b04 | ||
|
|
05033c9ebd | ||
|
|
ced675de22 | ||
|
|
4d81bf937f | ||
|
|
6d3fa654b7 | ||
|
|
e6211038cb | ||
|
|
48d629eb45 | ||
|
|
62f9d1e3ae | ||
|
|
1dfdae6de4 | ||
|
|
4dd03651f3 | ||
|
|
0c84740450 |
No files matched your search
@@ -1,21 +1,289 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
09 Jun 2016 PHP 7.0.8RC1
|
||||
04 Aug 2016 PHP 7.0.10RC1
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72629 (Caught exception assignment to variables ignores
|
||||
references). (Laruence)
|
||||
. Fixed bug #72594 (Calling an earlier instance of an included anonymous
|
||||
class fatals). (Laruence)
|
||||
. Fixed bug #72581 (previous property undefined in Exception after
|
||||
deserialization). (Laruence)
|
||||
. Fixed bug #72496 (Cannot declare public method with signature incompatible
|
||||
with parent private method). (Pedro Magalhães)
|
||||
. Fixed bug #72024 (microtime() leaks memory). (maroszek at gmx dot net)
|
||||
. Fixed bug #71911 (Unable to set --enable-debug on building extensions by
|
||||
phpize on Windows). (Yuji Uchiyama)
|
||||
. Fixed bug causing ClosedGeneratorException being thrown into the calling
|
||||
code instead of the Generator yielding from. (Bob)
|
||||
. Implemented FR #72614 (Support "nmake test" on building extensions by
|
||||
phpize). (Yuji Uchiyama)
|
||||
. Fixed bug #72641 (phpize (on Windows) ignores PHP_PREFIX).
|
||||
(Yuji Uchiyama)
|
||||
. Fixed potential segfault in object storage freeing in shutdown sequence.
|
||||
(Bob)
|
||||
. Fixed bug #72683 (getmxrr broken). (Anatol)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #67976 (cal_days_month() fails for final month of the French
|
||||
calendar). (cmb)
|
||||
. Fixed bug #71894 (AddressSanitizer: global-buffer-overflow in
|
||||
zif_cal_from_jd). (cmb)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #72569 (DOTNET/COM array parameters broke in PHP7). (Anatol)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER).
|
||||
(Pierrick)
|
||||
. Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
|
||||
range). (bugs dot php dot net at majkl578 dot cz)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user).
|
||||
(gooh)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb)
|
||||
. Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb)
|
||||
. Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb)
|
||||
. Fixed bug #43828 (broken transparency of imagearc for truecolor in
|
||||
blendingmode). (cmb)
|
||||
. Fixed bug #66555 (Always false condition in ext/gd/libgd/gdkanji.c). (cmb)
|
||||
. Fixed bug #68712 (suspicious if-else statements). (cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #72639 (Segfault when instantiating class that extends
|
||||
IntlCalendar and adds a property). (Laruence)
|
||||
. Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
|
||||
names). (cmb)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width).
|
||||
(cmb)
|
||||
. Fixed bug #72693 (mb_ereg_search increments search position when a match
|
||||
zero-width). (cmb)
|
||||
. Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last
|
||||
position). (cmb)
|
||||
. Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error).
|
||||
(ju1ius)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
|
||||
(Keyur)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #72688 (preg_match missing group names in matches). (cmb)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
|
||||
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
|
||||
specifying a sequence). (Pablo Santiago Sánchez)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #72222 (ReflectionClass::export doesn't handle array constants).
|
||||
(Nikita Nefedov)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML
|
||||
element). (Laruence)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU)
|
||||
. Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
|
||||
character). (cmb)
|
||||
. Fixed bug #72684 (AppendIterator segfault with closed generator). (Pierrick)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #72668 (Spurious warning when exception is thrown in user defined
|
||||
function). (Laruence)
|
||||
. Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash). (Laruence)
|
||||
. Implemented FR #72653 (SQLite should allow opening with empty filename).
|
||||
(cmb)
|
||||
. Updated to SQLite3 3.13.0. (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72622 (array_walk + array_replace_recursive create references
|
||||
from nothing). (Laruence)
|
||||
. Fixed bug #72152 (base64_decode $strict fails to detect null byte).
|
||||
(Lauri Kenttä)
|
||||
. Fixed bug #72263 (base64_decode skips a character after padding in strict
|
||||
mode). (Lauri Kenttä)
|
||||
. Fixed bug #72264 (base64_decode $strict fails with whitespace between
|
||||
padding). (Lauri Kenttä)
|
||||
. Fixed bug #72330 (CSV fields incorrectly split if escape char followed by
|
||||
UTF chars). (cmb)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #41021 (Problems with the ftps wrapper). (vhuk)
|
||||
. Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk)
|
||||
. Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for
|
||||
non-existent directories). (vhuk)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
|
||||
array elements). (Laruence)
|
||||
|
||||
- Wddx:
|
||||
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
|
||||
. Fixed bug #72142 (WDDX Packet Injection Vulnerability in
|
||||
wddx_serialize_value()). (Taoguang Chen)
|
||||
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
|
||||
(Laruence)
|
||||
|
||||
21 Jul 2016 PHP 7.0.9
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72508 (strange references after recursive function call and
|
||||
"switch" statement). (Laruence)
|
||||
. Fixed bug #72513 (Stack-based buffer overflow vulnerability in
|
||||
virtual_file_ex). (Stas)
|
||||
. Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries
|
||||
and applications). (Stas)
|
||||
|
||||
- bz2:
|
||||
. Fixed bug #72613 (Inadequate error handling in bzread()). (Stas)
|
||||
|
||||
- CLI:
|
||||
. Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify
|
||||
router.php). (Laruence)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #72498 (variant_date_from_timestamp null dereference). (Anatol)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #72541 (size_t overflow lead to heap corruption). (Stas)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails
|
||||
parsing). (derick)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE).
|
||||
(Stas)
|
||||
. Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment).
|
||||
(Stas)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb)
|
||||
. Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb)
|
||||
. Fixed bug #64641 (imagefilledpolygon doesn't draw horizontal line). (cmb)
|
||||
. Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read
|
||||
access). (Pierre)
|
||||
. Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre)
|
||||
. Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()).
|
||||
(Pierre)
|
||||
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
|
||||
overflow). (Pierre)
|
||||
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) -
|
||||
oob read access). (Laruence)
|
||||
. Fixed bug #72399 (Use-After-Free in MBString (search_re)). (Laruence)
|
||||
|
||||
- mcrypt:
|
||||
. Fixed bug #72551, bug #72552 (In correct casting from size_t to int lead to
|
||||
heap overflow in mdecrypt_generic). (Stas)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #72570 (Segmentation fault when binding parameters on a query
|
||||
without placeholders). (Matteo)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #72476 (Memleak in jit_stack). (Laruence)
|
||||
. Fixed bug #72463 (mail fails with invalid argument). (Anatol)
|
||||
|
||||
- Readline:
|
||||
. Fixed bug #72538 (readline_redisplay crashes php). (Laruence)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72505 (readfile() mangles files larger than 2G). (Cschneid)
|
||||
. Fixed bug #72306 (Heap overflow through proc_open and $env parameter).
|
||||
(Laruence)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #72531 (ps_files_cleanup_dir Buffer overflow). (Laruence)
|
||||
. Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session
|
||||
Deserialization). (Stas)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and
|
||||
unserialize()). (Stas)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #72439 (Stream socket with remote address leads to a segmentation
|
||||
fault). (Laruence)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn
|
||||
simplestring.c). (Stas)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #72520 (Stack-based buffer overflow vulnerability in
|
||||
php_stream_zip_opener). (Stas)
|
||||
|
||||
23 Jun 2016 PHP 7.0.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #72221 (segfault, past-the-end access). (Lauri Kenttä)
|
||||
. Fixed bug #72218 (If host name cannot be resolved then PHP 7 crashes).
|
||||
(Esminis at esminis dot lt)
|
||||
. Fixed bug #72221 (segfault, past-the-end access). (Lauri Kenttä)
|
||||
. Fixed bug #72268 (Integer Overflow in nl2br()). (Stas)
|
||||
. Fixed bug #72275 (Integer Overflow in json_encode()/json_decode()/
|
||||
json_utf8_to_utf16()). (Stas)
|
||||
. Fixed bug #72400 (Integer Overflow in addcslashes/addslashes). (Stas)
|
||||
. Fixed bug #72403 (Integer Overflow in Length of String-typed ZVAL). (Stas)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #63740 (strtotime seems to use both sunday and monday as start of
|
||||
week). (Derick)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #72308 (fastcgi_finish_request and logging environment
|
||||
variables). (Laruence)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #72337 (invalid dimensions can lead to crash) (Pierre)
|
||||
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
|
||||
(cmb)
|
||||
. Fixed bug #72298 (pass2_no_dither out-of-bounds access). (Stas)
|
||||
. Fixed bug #72337 (invalid dimensions can lead to crash). (Pierre)
|
||||
. Fixed bug #72339 (Integer Overflow in _gd2GetHeader() resulting in heap
|
||||
overflow). (CVE-2016-5766) (Pierre)
|
||||
. Fixed bug #72407 (NULL Pointer Dereference at _gdScaleVert). (Stas)
|
||||
. Fixed bug #72446 (Integer Overflow in gdImagePaletteToTrueColor() resulting
|
||||
in heap overflow). (CVE-2016-5767) (Pierre)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #64524 (Add intl.use_exceptions to php.ini-*). (Anatol)
|
||||
. Fixed bug #70484 (selectordinal doesn't work with named parameters).
|
||||
(Anatol)
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #72402 (_php_mb_regex_ereg_replace_exec - double free).
|
||||
(CVE-2016-5768) (Stas)
|
||||
|
||||
- mcrypt:
|
||||
. Fixed bug #72455 (Heap Overflow due to integer overflows). (CVE-2016-5769)
|
||||
(Stas)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #72140 (segfault after calling ERR_free_strings()).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #72143 (preg_replace uses int instead of size_t). (Joe)
|
||||
@@ -26,6 +294,10 @@ PHP NEWS
|
||||
. Fixed bug #72294 (Segmentation fault/invalid pointer in connection
|
||||
with pgsql_stmt_dtor). (Anatol)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #72321 (invalid free in phar_extract_file()).
|
||||
(hji at dyntopia dot com)
|
||||
|
||||
- Phpdbg:
|
||||
. Fixed bug #72284 (phpdbg fatal errors with coverage). (Bob)
|
||||
|
||||
@@ -34,6 +306,7 @@ PHP NEWS
|
||||
. Fixed bug #72197 (pg_lo_create arbitrary read). (Anatol)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #72369 (array_merge() produces references in PHP7). (Dmitry)
|
||||
. Fixed bug #72300 (ignore_user_abort(false) has no effect). (Laruence)
|
||||
. Fixed bug #72229 (Wrong reference when serialize/unserialize an object).
|
||||
(Laruence)
|
||||
@@ -42,6 +315,10 @@ PHP NEWS
|
||||
. Fixed bug #72017 (range() with float step produces unexpected result).
|
||||
(Thomas Punt)
|
||||
|
||||
- WDDX:
|
||||
. Fixed bug #72340 (Double Free Courruption in wddx_deserialize).
|
||||
(CVE-2016-5772) (Stas)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #72206 (xml_parser_create/xml_parser_free leaks mem). (Joe)
|
||||
|
||||
@@ -52,6 +329,8 @@ PHP NEWS
|
||||
- Zip:
|
||||
. Fixed ug #72258 (ZipArchive converts filenames to unrecoverable form).
|
||||
(Anatol)
|
||||
. Fixed bug #72434 (ZipArchive class Use After Free Vulnerability in PHP's GC
|
||||
algorithm and unserialize). (CVE-2016-5773) (Dmitry)
|
||||
|
||||
26 May 2016 PHP 7.0.7
|
||||
|
||||
@@ -80,7 +359,8 @@ PHP NEWS
|
||||
. Fixed bug #72227 (imagescale out-of-bounds read). (Stas)
|
||||
|
||||
- Intl:
|
||||
. Fixed #72241 (get_icu_value_internal out-of-bounds read). (Stas)
|
||||
. Fixed bug #64524 (Add intl.use_exceptions to php.ini-*). (Anatol)
|
||||
. Fixed bug #72241 (get_icu_value_internal out-of-bounds read). (Stas)
|
||||
|
||||
- JSON:
|
||||
. Fixed bug #72069 (Behavior \JsonSerializable different from json_encode).
|
||||
@@ -1004,7 +1284,8 @@ PHP NEWS
|
||||
|
||||
- GD:
|
||||
. Fixed bug #53156 (imagerectangle problem with point ordering). (cmb)
|
||||
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (cmb)
|
||||
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
|
||||
(cmb)
|
||||
. Fixed bug #70102 (imagecreatefromwebm() shifts colors). (cmb)
|
||||
. Fixed bug #66590 (imagewebp() doesn't pad to even length). (cmb)
|
||||
. Fixed bug #66882 (imagerotate by -90 degrees truncates image by 1px). (cmb)
|
||||
@@ -1090,7 +1371,7 @@ PHP NEWS
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #69975 (PHP segfaults when accessing nvarchar(max) defined
|
||||
columns). (cmb)
|
||||
columns). (CVE-2015-8879) (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #70656 (require() statement broken after opcache_reset() or a
|
||||
|
||||
@@ -442,6 +442,8 @@ Other
|
||||
- Curl:
|
||||
. Removed support for disabling the CURLOPT_SAFE_UPLOAD option. All curl file
|
||||
uploads must use the curl_file / CURLFile APIs.
|
||||
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 5.6.25)
|
||||
|
||||
- Date:
|
||||
. Removed $is_dst parameter from mktime() and gmmktime().
|
||||
@@ -641,6 +643,10 @@ Other
|
||||
- debug_zval_dump
|
||||
It prints now "int" instead of "long", and "float" instead of "double".
|
||||
|
||||
- getenv()
|
||||
Since 7.0.9, getenv() has optional second parameter, making it only
|
||||
consider local environment and not SAPI environment if true.
|
||||
|
||||
========================================
|
||||
6. New Functions
|
||||
========================================
|
||||
@@ -740,6 +746,8 @@ out, that the corresponding SDK isn't available anymore.
|
||||
. ZLIB_FINISH
|
||||
|
||||
- GD
|
||||
. IMG_WEBP (>= 7.0.10)
|
||||
|
||||
. T1Lib support removed, thus lifting the optional dependency on T1Lib, the
|
||||
following is therefore not available anymore:
|
||||
|
||||
@@ -815,3 +823,7 @@ out, that the corresponding SDK isn't available anymore.
|
||||
of aditional information with internal functions. In PHP-5 it was possible
|
||||
to use zend_function.op_array.reserved[] even for internal functions, but
|
||||
now we don't allocate extra space.
|
||||
|
||||
- CURL
|
||||
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
|
||||
as a string (PHP >= 7.0.10)
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #72496 (declare public method with signature incompatible with parent private method should not throw a warning)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo
|
||||
{
|
||||
private function getFoo()
|
||||
{
|
||||
return 'Foo';
|
||||
}
|
||||
|
||||
private function getBar()
|
||||
{
|
||||
return 'Bar';
|
||||
}
|
||||
|
||||
private function getBaz()
|
||||
{
|
||||
return 'Baz';
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
public function getFoo($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
protected function getBar($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
|
||||
private function getBaz($extraArgument)
|
||||
{
|
||||
return $extraArgument;
|
||||
}
|
||||
}
|
||||
|
||||
echo "OK\n";
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #72508 (strange references after recursive function call and "switch" statement)
|
||||
--FILE--
|
||||
<?php
|
||||
function a ($option) {
|
||||
b($option['bla']);
|
||||
c($option);
|
||||
var_dump($option);
|
||||
}
|
||||
function b (&$string) {
|
||||
$string = 'changed';
|
||||
}
|
||||
function c ($option) {
|
||||
switch ($option['bla']) {
|
||||
default:
|
||||
$copy = $option;
|
||||
$copy['bla'] = 'copy';
|
||||
break;
|
||||
}
|
||||
}
|
||||
a(array('bla' => 'fasel'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["bla"]=>
|
||||
string(7) "changed"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #72581 (previous property undefined in Exception after deserialization)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$e = new Exception('aaa', 200);
|
||||
|
||||
$a = serialize($e);
|
||||
|
||||
$b = unserialize($a);
|
||||
|
||||
var_dump($b->__toString());
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%s) "Exception: aaa in %sbug72581.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #72594 (Calling an earlier instance of an included anonymous class fatals)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
--FILE--
|
||||
<?php
|
||||
if (isset($runtime)) {
|
||||
return new class {
|
||||
public $bar;
|
||||
public function bing($foo = null) {
|
||||
if ($foo) $foo->bing();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$runtime = 1;
|
||||
$oldFoo = require(__FILE__);
|
||||
$newFoo = require(__FILE__);
|
||||
|
||||
var_dump(get_class_methods($oldFoo));
|
||||
var_dump(get_object_vars($oldFoo));
|
||||
|
||||
$newFoo->bing($oldFoo);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(4) "bing"
|
||||
}
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
NULL
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
call_user_func() should not use FUNC_ARG fetches
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo(&$ref) { $ref = 24; }
|
||||
|
||||
$a = [];
|
||||
call_user_func('foo', $a[0][0]);
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined offset: 0 in %s on line %d
|
||||
|
||||
Warning: Parameter 1 to foo() expected to be a reference, value given in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
@@ -40,11 +40,10 @@ Stack trace:
|
||||
#2 %s(%d): Generator->next()
|
||||
#3 {main}
|
||||
Generator 1
|
||||
|
||||
Fatal error: Uncaught ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Caught exception!
|
||||
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
|
||||
Stack trace:
|
||||
#0 [internal function]: gen(Object(Generator))
|
||||
#1 %s(%d): Generator->current()
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
|
||||
NULL
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #72629 (Caught exception assignment to variables ignores references)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$var = null;
|
||||
$e = &$var;
|
||||
|
||||
try {
|
||||
throw new Exception;
|
||||
} catch (Exception $e) { }
|
||||
|
||||
var_dump($var === $e);
|
||||
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
+2
-2
@@ -3100,13 +3100,13 @@ get_function_via_handler:
|
||||
|
||||
if (retval) {
|
||||
if (fcc->calling_scope && !call_via_handler) {
|
||||
if (!fcc->object && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
|
||||
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT) {
|
||||
if (error) {
|
||||
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
retval = 0;
|
||||
} else {
|
||||
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
|
||||
return 0;
|
||||
retval = 0;
|
||||
}
|
||||
} else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
int severity;
|
||||
|
||||
@@ -2388,8 +2388,10 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
if (object) {
|
||||
if (func->common.scope) {
|
||||
class_name = func->common.scope->name;
|
||||
} else {
|
||||
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
|
||||
class_name = object->ce->name;
|
||||
} else {
|
||||
class_name = object->handlers->get_class_name(object);
|
||||
}
|
||||
|
||||
call_type = "->";
|
||||
@@ -2449,6 +2451,11 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
if (class_name) {
|
||||
ZEND_PUTS(ZSTR_VAL(class_name));
|
||||
ZEND_PUTS(call_type);
|
||||
if (object
|
||||
&& !func->common.scope
|
||||
&& object->handlers->get_class_name != std_object_handlers.get_class_name) {
|
||||
zend_string_release(class_name);
|
||||
}
|
||||
}
|
||||
zend_printf("%s(", function_name);
|
||||
if (Z_TYPE(arg_array) != IS_UNDEF) {
|
||||
@@ -2608,9 +2615,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
if (object) {
|
||||
if (func->common.scope) {
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(func->common.scope->name));
|
||||
} else {
|
||||
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(object->ce->name));
|
||||
|
||||
} else {
|
||||
zend_string *class_name = object->handlers->get_class_name(object);
|
||||
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, class_name);
|
||||
zend_string_release(class_name);
|
||||
}
|
||||
if ((options & DEBUG_BACKTRACE_PROVIDE_OBJECT) != 0) {
|
||||
zval zv;
|
||||
|
||||
+30
-17
@@ -3070,19 +3070,9 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
|
||||
zend_ast *arg_ast = args->child[i];
|
||||
znode arg_node;
|
||||
zend_op *opline;
|
||||
zend_bool send_user = 0;
|
||||
|
||||
if (zend_is_variable(arg_ast) && !zend_is_call(arg_ast)) {
|
||||
zend_compile_var(&arg_node, arg_ast, BP_VAR_FUNC_ARG | (i << BP_VAR_SHIFT));
|
||||
send_user = 1;
|
||||
} else {
|
||||
zend_compile_expr(&arg_node, arg_ast);
|
||||
if (arg_node.op_type & (IS_VAR|IS_CV)) {
|
||||
send_user = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (send_user) {
|
||||
zend_compile_expr(&arg_node, arg_ast);
|
||||
if (arg_node.op_type & (IS_VAR|IS_CV)) {
|
||||
opline = zend_emit_op(NULL, ZEND_SEND_USER, &arg_node, NULL);
|
||||
} else {
|
||||
opline = zend_emit_op(NULL, ZEND_SEND_VAL, &arg_node, NULL);
|
||||
@@ -4035,16 +4025,32 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
|
||||
|
||||
znode expr_node, case_node;
|
||||
zend_op *opline;
|
||||
uint32_t *jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
|
||||
uint32_t opnum_default_jmp;
|
||||
uint32_t *jmpnz_opnums, opnum_default_jmp;
|
||||
|
||||
zend_compile_expr(&expr_node, expr_ast);
|
||||
|
||||
if (cases->children == 1 && cases->child[0]->child[0] == NULL) {
|
||||
/* we have to take care about the case that only have one default branch,
|
||||
* expr result will not be unrefed in this case, but it should be like in ZEND_CASE */
|
||||
zend_ast *stmt_ast = cases->child[0]->child[1];
|
||||
if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) {
|
||||
zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL);
|
||||
} else if (expr_node.op_type == IS_CONST) {
|
||||
zval_dtor(&expr_node.u.constant);
|
||||
}
|
||||
|
||||
zend_begin_loop(ZEND_NOP, NULL);
|
||||
zend_compile_stmt(stmt_ast);
|
||||
zend_end_loop(get_next_op_number(CG(active_op_array)));
|
||||
return;
|
||||
}
|
||||
|
||||
zend_begin_loop(ZEND_FREE, &expr_node);
|
||||
|
||||
case_node.op_type = IS_TMP_VAR;
|
||||
case_node.u.op.var = get_temporary_variable(CG(active_op_array));
|
||||
|
||||
jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
|
||||
for (i = 0; i < cases->children; ++i) {
|
||||
zend_ast *case_ast = cases->child[i];
|
||||
zend_ast *cond_ast = case_ast->child[0];
|
||||
@@ -5277,7 +5283,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
opline = get_next_op(CG(active_op_array));
|
||||
zend_make_var_result(&declare_node, opline);
|
||||
|
||||
// TODO.AST drop this
|
||||
/* TODO.AST drop this */
|
||||
GET_NODE(&FC(implementing_class), opline->result);
|
||||
|
||||
opline->op2_type = IS_CONST;
|
||||
@@ -5293,7 +5299,15 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
|
||||
|
||||
opline->op1_type = IS_UNUSED;
|
||||
|
||||
zend_hash_update_ptr(CG(class_table), lcname, ce);
|
||||
if (!zend_hash_exists(CG(class_table), lcname)) {
|
||||
zend_hash_add_ptr(CG(class_table), lcname, ce);
|
||||
} else {
|
||||
/* this anonymous class has been included */
|
||||
zval zv;
|
||||
ZVAL_PTR(&zv, ce);
|
||||
destroy_zend_class(&zv);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
zend_string *key;
|
||||
|
||||
@@ -5580,7 +5594,6 @@ void zend_compile_group_use(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
void zend_compile_const_decl(zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast_list *list = zend_ast_get_list(ast);
|
||||
|
||||
@@ -291,9 +291,8 @@ ZEND_METHOD(exception, __construct)
|
||||
/* {{{ proto Exception::__wakeup()
|
||||
Exception unserialize checks */
|
||||
#define CHECK_EXC_TYPE(name, type) \
|
||||
ZVAL_UNDEF(&value); \
|
||||
pvalue = zend_read_property(i_get_exception_base(object), (object), name, sizeof(name) - 1, 1, &value); \
|
||||
if(Z_TYPE_P(pvalue) != IS_UNDEF && Z_TYPE_P(pvalue) != type) { \
|
||||
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
|
||||
zval tmp; \
|
||||
ZVAL_STRINGL(&tmp, name, sizeof(name) - 1); \
|
||||
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
|
||||
@@ -563,11 +562,14 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
|
||||
case IS_ARRAY:
|
||||
smart_str_appends(str, "Array, ");
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
case IS_OBJECT: {
|
||||
zend_string *class_name = Z_OBJ_HANDLER_P(arg, get_class_name)(Z_OBJ_P(arg));
|
||||
smart_str_appends(str, "Object(");
|
||||
smart_str_appends(str, ZSTR_VAL(Z_OBJCE_P(arg)->name));
|
||||
smart_str_appends(str, ZSTR_VAL(class_name));
|
||||
smart_str_appends(str, "), ");
|
||||
zend_string_release(class_name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1069,6 +1071,7 @@ ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */
|
||||
|
||||
if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) {
|
||||
zend_throw_error(NULL, "Cannot throw objects that do not implement Throwable");
|
||||
zval_ptr_dtor(exception);
|
||||
return;
|
||||
}
|
||||
zend_throw_exception_internal(exception);
|
||||
|
||||
+4
-1
@@ -2444,9 +2444,12 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
|
||||
|
||||
if (UNEXPECTED(opline->opcode == ZEND_INIT_FCALL ||
|
||||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
|
||||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
|
||||
opline->opcode == ZEND_INIT_DYNAMIC_CALL ||
|
||||
opline->opcode == ZEND_INIT_USER_CALL ||
|
||||
opline->opcode == ZEND_INIT_METHOD_CALL ||
|
||||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL)) {
|
||||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
|
||||
opline->opcode == ZEND_NEW)) {
|
||||
ZEND_ASSERT(op_num);
|
||||
opline--;
|
||||
}
|
||||
|
||||
@@ -1097,6 +1097,7 @@ ZEND_API int zend_gc_collect_cycles(void)
|
||||
|
||||
if (EG(objects_store).object_buckets &&
|
||||
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) {
|
||||
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
|
||||
GC_TYPE(obj) = IS_NULL;
|
||||
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
|
||||
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
|
||||
|
||||
@@ -521,6 +521,16 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
|
||||
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
|
||||
|
||||
EG(current_execute_data) = original_execute_data;
|
||||
|
||||
if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
|
||||
leaf->node.ptr.root = root;
|
||||
root->node.parent = NULL;
|
||||
if (old_root) {
|
||||
OBJ_RELEASE(&old_root->std);
|
||||
}
|
||||
zend_generator_resume(leaf);
|
||||
return leaf->node.ptr.root; /* this may be updated during zend_generator_resume! */
|
||||
}
|
||||
} else {
|
||||
zval_ptr_dtor(&root->value);
|
||||
ZVAL_COPY(&root->value, &root->node.parent->value);
|
||||
|
||||
@@ -268,8 +268,8 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If both methods are private do not enforce a signature */
|
||||
if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
|
||||
/* If the prototype method is private do not enforce a signature */
|
||||
if (proto->common.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1187,7 +1187,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
int add_slash;
|
||||
void *tmp;
|
||||
|
||||
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
|
||||
if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
|
||||
#ifdef ZEND_WIN32
|
||||
_set_errno(EINVAL);
|
||||
#else
|
||||
|
||||
+14
-2
@@ -2312,6 +2312,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
|
||||
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
|
||||
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
|
||||
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
|
||||
FREE_UNFETCHED_OP1();
|
||||
FREE_OP2_VAR_PTR();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -4153,6 +4154,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
|
||||
USE_OPLINE
|
||||
zend_class_entry *ce, *catch_ce;
|
||||
zend_object *exception;
|
||||
zval *ex;
|
||||
|
||||
SAVE_OPLINE();
|
||||
/* Check whether an exception has been thrown, if not, jump over code */
|
||||
@@ -4187,8 +4189,12 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
|
||||
}
|
||||
|
||||
exception = EG(exception);
|
||||
zval_ptr_dtor(EX_VAR(opline->op2.var));
|
||||
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
|
||||
ex = EX_VAR(opline->op2.var);
|
||||
if (UNEXPECTED(Z_ISREF_P(ex))) {
|
||||
ex = Z_REFVAL_P(ex);
|
||||
}
|
||||
zval_ptr_dtor(ex);
|
||||
ZVAL_OBJ(ex, EG(exception));
|
||||
if (UNEXPECTED(EG(exception) != exception)) {
|
||||
GC_REFCOUNT(EG(exception))++;
|
||||
HANDLE_EXCEPTION();
|
||||
@@ -5449,6 +5455,10 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
|
||||
}
|
||||
FREE_OP1();
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (new_op_array != NULL) {
|
||||
destroy_op_array(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (EXPECTED(new_op_array != NULL)) {
|
||||
zval *return_value = NULL;
|
||||
@@ -7469,12 +7479,14 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
|
||||
if (Z_ISUNDEF(new_gen->retval)) {
|
||||
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
|
||||
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
zend_generator_yield_from(generator, new_gen);
|
||||
}
|
||||
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
|
||||
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
|
||||
+31
-2
@@ -3637,6 +3637,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HAN
|
||||
}
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (new_op_array != NULL) {
|
||||
destroy_op_array(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (EXPECTED(new_op_array != NULL)) {
|
||||
zval *return_value = NULL;
|
||||
@@ -4131,12 +4135,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(
|
||||
if (Z_ISUNDEF(new_gen->retval)) {
|
||||
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
|
||||
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
zend_generator_yield_from(generator, new_gen);
|
||||
}
|
||||
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
|
||||
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
@@ -9547,6 +9553,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZE
|
||||
USE_OPLINE
|
||||
zend_class_entry *ce, *catch_ce;
|
||||
zend_object *exception;
|
||||
zval *ex;
|
||||
|
||||
SAVE_OPLINE();
|
||||
/* Check whether an exception has been thrown, if not, jump over code */
|
||||
@@ -9581,8 +9588,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZE
|
||||
}
|
||||
|
||||
exception = EG(exception);
|
||||
zval_ptr_dtor(EX_VAR(opline->op2.var));
|
||||
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
|
||||
ex = EX_VAR(opline->op2.var);
|
||||
if (UNEXPECTED(Z_ISREF_P(ex))) {
|
||||
ex = Z_REFVAL_P(ex);
|
||||
}
|
||||
zval_ptr_dtor(ex);
|
||||
ZVAL_OBJ(ex, EG(exception));
|
||||
if (UNEXPECTED(EG(exception) != exception)) {
|
||||
GC_REFCOUNT(EG(exception))++;
|
||||
HANDLE_EXCEPTION();
|
||||
@@ -12533,12 +12544,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE
|
||||
if (Z_ISUNDEF(new_gen->retval)) {
|
||||
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
|
||||
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
zend_generator_yield_from(generator, new_gen);
|
||||
}
|
||||
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
|
||||
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
@@ -16359,12 +16372,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE
|
||||
if (Z_ISUNDEF(new_gen->retval)) {
|
||||
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
|
||||
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
zend_generator_yield_from(generator, new_gen);
|
||||
}
|
||||
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
|
||||
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
@@ -18499,6 +18514,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLE
|
||||
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
|
||||
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
|
||||
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
|
||||
if (UNEXPECTED(free_op2)) {zval_ptr_dtor_nogc(free_op2);};
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -20785,6 +20801,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER
|
||||
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
|
||||
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
|
||||
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -29308,6 +29325,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLE
|
||||
}
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (new_op_array != NULL) {
|
||||
destroy_op_array(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (EXPECTED(new_op_array != NULL)) {
|
||||
zval *return_value = NULL;
|
||||
@@ -29802,12 +29823,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN
|
||||
if (Z_ISUNDEF(new_gen->retval)) {
|
||||
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
|
||||
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
zend_generator_yield_from(generator, new_gen);
|
||||
}
|
||||
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
|
||||
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
|
||||
zval_ptr_dtor(val);
|
||||
HANDLE_EXCEPTION();
|
||||
} else {
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
@@ -33607,6 +33630,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER
|
||||
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
|
||||
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
|
||||
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
|
||||
|
||||
if (UNEXPECTED(free_op2)) {zval_ptr_dtor_nogc(free_op2);};
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -37022,6 +37046,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(
|
||||
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
|
||||
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
|
||||
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
if (IS_CV == IS_VAR &&
|
||||
@@ -40840,6 +40865,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HA
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (new_op_array != NULL) {
|
||||
destroy_op_array(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
} else if (EXPECTED(new_op_array != NULL)) {
|
||||
zval *return_value = NULL;
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=8
|
||||
PHP_RELEASE_VERSION=10
|
||||
PHP_EXTRA_VERSION="RC1"
|
||||
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`
|
||||
|
||||
+5
-1
@@ -148,7 +148,11 @@ static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count)
|
||||
just_read = BZ2_bzread(self->bz_file, buf, to_read);
|
||||
|
||||
if (just_read < 1) {
|
||||
stream->eof = 0 == just_read;
|
||||
/* it is not safe to keep reading after an error, see #72613 */
|
||||
stream->eof = 1;
|
||||
if (just_read < 0) {
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #72447: Type Confusion in php_bz2_filter_create()
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$input = "AAAAAAAA";
|
||||
$param = array('blocks' => $input);
|
||||
|
||||
$fp = fopen('testfile', 'w');
|
||||
stream_filter_append($fp, 'bzip2.compress', STREAM_FILTER_WRITE, $param);
|
||||
fclose($fp);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: stream_filter_append(): Invalid parameter given for number of blocks to allocate. (0) in %s%ebug72447.php on line %d
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #72613 (Inadequate error handling in bzread())
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fp = bzopen(__DIR__.'/72613.bz2', 'r');
|
||||
if ($fp === FALSE) {
|
||||
exit("ERROR: bzopen()");
|
||||
}
|
||||
$data = "";
|
||||
while (!feof($fp)) {
|
||||
$res = bzread($fp);
|
||||
if ($res === FALSE) {
|
||||
exit("ERROR: bzread()");
|
||||
}
|
||||
$data .= $res;
|
||||
}
|
||||
bzclose($fp);
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
+17
-7
@@ -357,6 +357,10 @@ PHP_FUNCTION(cal_days_in_month)
|
||||
}
|
||||
else {
|
||||
sdn_next = calendar->to_jd(year + 1, 1, 1);
|
||||
if (cal == CAL_FRENCH && sdn_next == 0) {
|
||||
/* The French calendar ends on 0014-13-05. */
|
||||
sdn_next = 2380953;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,15 +418,21 @@ PHP_FUNCTION(cal_from_jd)
|
||||
add_assoc_long(return_value, "year", year);
|
||||
|
||||
/* day of week */
|
||||
dow = DayOfWeek(jd);
|
||||
add_assoc_long(return_value, "dow", dow);
|
||||
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
|
||||
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
|
||||
if (cal != CAL_JEWISH || year > 0) {
|
||||
dow = DayOfWeek(jd);
|
||||
add_assoc_long(return_value, "dow", dow);
|
||||
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
|
||||
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
|
||||
} else {
|
||||
add_assoc_null(return_value, "dow");
|
||||
add_assoc_string(return_value, "abbrevdayname", "");
|
||||
add_assoc_string(return_value, "dayname", "");
|
||||
}
|
||||
/* month name */
|
||||
if(cal == CAL_JEWISH) {
|
||||
/* special case for Jewish calendar */
|
||||
add_assoc_string(return_value, "abbrevmonth", JEWISH_MONTH_NAME(year)[month]);
|
||||
add_assoc_string(return_value, "monthname", JEWISH_MONTH_NAME(year)[month]);
|
||||
add_assoc_string(return_value, "abbrevmonth", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
|
||||
add_assoc_string(return_value, "monthname", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
|
||||
} else {
|
||||
add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month]);
|
||||
add_assoc_string(return_value, "monthname", calendar->month_name_long[month]);
|
||||
@@ -735,7 +745,7 @@ PHP_FUNCTION(jdmonthname)
|
||||
break;
|
||||
case CAL_MONTH_JEWISH: /* jewish month */
|
||||
SdnToJewish(julday, &year, &month, &day);
|
||||
monthname = JEWISH_MONTH_NAME(year)[month];
|
||||
monthname = (year > 0 ? JEWISH_MONTH_NAME(year)[month] : "");
|
||||
break;
|
||||
case CAL_MONTH_FRENCH: /* french month */
|
||||
SdnToFrench(julday, &year, &month, &day);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #67976 (cal_days_month() fails for final month of the French calendar)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(cal_days_in_month(CAL_FRENCH, 13, 14));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(5)
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #71894 (AddressSanitizer: global-buffer-overflow in zif_cal_from_jd)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(cal_from_jd(347997, CAL_JEWISH));
|
||||
var_dump(jdmonthname(347997,CAL_MONTH_JEWISH));?>
|
||||
--EXPECT--
|
||||
array(9) {
|
||||
["date"]=>
|
||||
string(5) "0/0/0"
|
||||
["month"]=>
|
||||
int(0)
|
||||
["day"]=>
|
||||
int(0)
|
||||
["year"]=>
|
||||
int(0)
|
||||
["dow"]=>
|
||||
NULL
|
||||
["abbrevdayname"]=>
|
||||
string(0) ""
|
||||
["dayname"]=>
|
||||
string(0) ""
|
||||
["abbrevmonth"]=>
|
||||
string(0) ""
|
||||
["monthname"]=>
|
||||
string(0) ""
|
||||
}
|
||||
string(0) ""
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
jdtogregorian(): test overflow
|
||||
--CREDITS--
|
||||
neweracracker@gmail.com
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
for ($i=536838860; $i<536838870; $i++) {
|
||||
echo $i, ':', jdtogregorian($i), PHP_EOL;
|
||||
}
|
||||
echo 'DONE', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
||||
536838860:10/11/1465102
|
||||
536838861:10/12/1465102
|
||||
536838862:10/13/1465102
|
||||
536838863:10/14/1465102
|
||||
536838864:10/15/1465102
|
||||
536838865:10/16/1465102
|
||||
536838866:10/17/1465102
|
||||
536838867:0/0/0
|
||||
536838868:0/0/0
|
||||
536838869:0/0/0
|
||||
DONE
|
||||
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
jdtojewish(): test overflow
|
||||
--CREDITS--
|
||||
neweracracker@gmail.com
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('calendar')) die('skip ext/calendar required');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
for ($i=324542840; $i<324542850; $i++) {
|
||||
echo $i, ':', jdtojewish($i), PHP_EOL;
|
||||
}
|
||||
echo 'DONE', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
||||
324542840:12/7/887605
|
||||
324542841:12/8/887605
|
||||
324542842:12/9/887605
|
||||
324542843:12/10/887605
|
||||
324542844:12/11/887605
|
||||
324542845:12/12/887605
|
||||
324542846:12/13/887605
|
||||
324542847:0/0/0
|
||||
324542848:0/0/0
|
||||
324542849:0/0/0
|
||||
DONE
|
||||
@@ -100,7 +100,12 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
|
||||
{
|
||||
OLECHAR *olestring;
|
||||
php_com_dotnet_object *obj;
|
||||
zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z));
|
||||
zend_uchar ztype = IS_NULL;
|
||||
|
||||
if (z) {
|
||||
ZVAL_DEREF(z);
|
||||
ztype = Z_TYPE_P(z);
|
||||
}
|
||||
|
||||
switch (ztype) {
|
||||
case IS_NULL:
|
||||
@@ -1007,6 +1012,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
|
||||
tzset();
|
||||
ttstamp = timestamp;
|
||||
tmv = localtime(&ttstamp);
|
||||
#if ZEND_ENABLE_ZVAL_LONG64
|
||||
/* Invalid after 23:59:59, December 31, 3000, UTC */
|
||||
if (!tmv) {
|
||||
php_error_docref(NULL, E_WARNING, "Invalid timestamp " ZEND_LONG_FMT, timestamp);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
memset(&systime, 0, sizeof(systime));
|
||||
|
||||
systime.wDay = tmv->tm_mday;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #72498 variant_date_from_timestamp null dereference
|
||||
--SKIPIF--
|
||||
<?php # vim:ft=php
|
||||
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
|
||||
if (PHP_INT_SIZE != 8) print "skip 64-bit only";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$v1 = PHP_INT_MAX;
|
||||
var_dump(variant_date_from_timestamp($v1));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: variant_date_from_timestamp(): Invalid timestamp %d in %sbug72498.php on line %d
|
||||
bool(false)
|
||||
+11
-46
@@ -1876,38 +1876,6 @@ static php_curl *alloc_curl_handle()
|
||||
/* }}} */
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
|
||||
/* {{{ split_certinfo
|
||||
*/
|
||||
static void split_certinfo(char *string, zval *hash)
|
||||
{
|
||||
char *org = estrdup(string);
|
||||
char *s = org;
|
||||
char *split;
|
||||
|
||||
if(org) {
|
||||
do {
|
||||
char *key;
|
||||
char *val;
|
||||
char *tmp;
|
||||
|
||||
split = strstr(s, "; ");
|
||||
if(split)
|
||||
*split = '\0';
|
||||
|
||||
key = s;
|
||||
tmp = memchr(key, '=', 64);
|
||||
if(tmp) {
|
||||
*tmp = '\0';
|
||||
val = tmp+1;
|
||||
add_assoc_string(hash, key, val);
|
||||
}
|
||||
s = split+2;
|
||||
} while(split);
|
||||
efree(org);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ create_certinfo
|
||||
*/
|
||||
static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
|
||||
@@ -1930,16 +1898,7 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
|
||||
if(tmp) {
|
||||
*tmp = '\0';
|
||||
len = strlen(s);
|
||||
if (!strcmp(s, "Subject") || !strcmp(s, "Issuer")) {
|
||||
zval hash;
|
||||
|
||||
array_init(&hash);
|
||||
|
||||
split_certinfo(&slist->data[len+1], &hash);
|
||||
add_assoc_zval(&certhash, s, &hash);
|
||||
} else {
|
||||
add_assoc_string(&certhash, s, &slist->data[len+1]);
|
||||
}
|
||||
add_assoc_string(&certhash, s, &slist->data[len+1]);
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "Could not extract hash key from certificate info");
|
||||
}
|
||||
@@ -2658,10 +2617,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
if ((*ch->clone) == 1) {
|
||||
zend_hash_index_update_ptr(ch->to_free->slist, option, slist);
|
||||
} else {
|
||||
zend_hash_next_index_insert_ptr(ch->to_free->slist, slist);
|
||||
if (slist) {
|
||||
if ((*ch->clone) == 1) {
|
||||
zend_hash_index_update_ptr(ch->to_free->slist, option, slist);
|
||||
} else {
|
||||
zend_hash_next_index_insert_ptr(ch->to_free->slist, slist);
|
||||
}
|
||||
}
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, slist);
|
||||
@@ -3595,6 +3556,10 @@ PHP_FUNCTION(curl_unescape)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (str_len > INT_MAX) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((out = curl_easy_unescape(ch->cp, str, str_len, &out_len))) {
|
||||
RETVAL_STRINGL(out, out_len);
|
||||
curl_free(out);
|
||||
|
||||
+103
-1661
File diff suppressed because it is too large.
Load diff
+1553
-1345
File diff suppressed because it is too large.
Load diff
+4
-2
@@ -2013,6 +2013,7 @@ static void date_register_classes(void) /* {{{ */
|
||||
date_object_handlers_immutable.clone_obj = date_object_clone_date;
|
||||
date_object_handlers_immutable.compare_objects = date_object_compare_date;
|
||||
date_object_handlers_immutable.get_properties = date_object_get_properties;
|
||||
date_object_handlers_immutable.get_gc = date_object_get_gc;
|
||||
zend_class_implements(date_ce_immutable, 1, date_ce_interface);
|
||||
|
||||
INIT_CLASS_ENTRY(ce_timezone, "DateTimeZone", date_funcs_timezone);
|
||||
@@ -2170,7 +2171,7 @@ static HashTable *date_object_get_properties(zval *object) /* {{{ */
|
||||
|
||||
props = zend_std_get_properties(object);
|
||||
|
||||
if (!dateobj->time || GC_G(gc_active)) {
|
||||
if (!dateobj->time) {
|
||||
return props;
|
||||
}
|
||||
|
||||
@@ -3610,6 +3611,7 @@ static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz, size
|
||||
|
||||
if (strlen(tz) != tz_len) {
|
||||
php_error_docref(NULL, E_WARNING, "Timezone must not contain null bytes");
|
||||
efree(dummy_t);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -4851,7 +4853,7 @@ static HashTable *date_object_get_properties_period(zval *object) /* {{{ */
|
||||
|
||||
props = zend_std_get_properties(object);
|
||||
|
||||
if (!period_obj->start || GC_G(gc_active)) {
|
||||
if (!period_obj->start) {
|
||||
return props;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ print "TZ=Asia/Baku - wrong day.\n";
|
||||
date_default_timezone_set("Asia/Baku");
|
||||
$tStamp = mktime (17, 17, 17, 1, 8299, 1970);
|
||||
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
|
||||
$strtotime_tstamp = strtotime("next Sunday", $tStamp);
|
||||
$strtotime_tstamp = strtotime("second Monday", $tStamp);
|
||||
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
|
||||
print "wanted=Sunday 00:00:00\n\n";
|
||||
print "wanted=Monday 00:00:00\n\n";
|
||||
|
||||
print "TZ=America/Noronha - wrong day.\n";
|
||||
date_default_timezone_set("America/Noronha");
|
||||
@@ -227,8 +227,8 @@ wanted=Thursday 00:00:00
|
||||
|
||||
TZ=Asia/Baku - wrong day.
|
||||
tStamp=Sunday 1992-09-20 17:17:17 AZST 1
|
||||
result=Sunday 1992-09-27 00:00:00 AZT 0
|
||||
wanted=Sunday 00:00:00
|
||||
result=Monday 1992-09-28 00:00:00 AZT 0
|
||||
wanted=Monday 00:00:00
|
||||
|
||||
TZ=America/Noronha - wrong day.
|
||||
tStamp=Friday 1999-10-01 17:17:17 FNT 0
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails parsing)
|
||||
--INI--
|
||||
date.timezone=Europe/Berlin
|
||||
--FILE--
|
||||
<?php
|
||||
foreach (['-1', '-86400', '-1000000'] as $timestamp) {
|
||||
$dt = DateTime::createFromFormat('U', $timestamp);
|
||||
var_dump($dt->format('U') === $timestamp);
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #66502 (DOM document dangling reference)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('dom')) die('skip requires ext/dom');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dom = new DOMDocument('1.0', 'UTF-8');
|
||||
$element = $dom->appendChild(new DOMElement('root'));
|
||||
$comment = new DOMComment("Comment 0");
|
||||
$comment = $element->appendChild($comment);
|
||||
|
||||
$comment->__construct("Comment 1");
|
||||
$comment->__construct("Comment 2");
|
||||
$comment->__construct("Comment 3");
|
||||
echo 'DONE', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
+46
-15
@@ -1703,6 +1703,10 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
break;
|
||||
case TAG_FMT_UNDEFINED:
|
||||
if (value) {
|
||||
if (tag == TAG_MAKER_NOTE) {
|
||||
length = MIN(length, strlen(value));
|
||||
}
|
||||
|
||||
/* do not recompute length here */
|
||||
info_value->s = estrndup(value, length);
|
||||
info_data->length = length;
|
||||
@@ -2604,6 +2608,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
*pszEncoding = NULL;
|
||||
/* Copy the comment */
|
||||
if (ByteCount>=8) {
|
||||
const zend_encoding *from, *to;
|
||||
if (!memcmp(szValuePtr, "UNICODE\0", 8)) {
|
||||
*pszEncoding = estrdup((const char*)szValuePtr);
|
||||
szValuePtr = szValuePtr+8;
|
||||
@@ -2624,15 +2629,16 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
} else {
|
||||
decode = ImageInfo->decode_unicode_le;
|
||||
}
|
||||
to = zend_multibyte_fetch_encoding(ImageInfo->encode_unicode);
|
||||
from = zend_multibyte_fetch_encoding(decode);
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
if (!to || !from || zend_multibyte_encoding_converter(
|
||||
(unsigned char**)pszInfoPtr,
|
||||
&len,
|
||||
(unsigned char*)szValuePtr,
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_unicode),
|
||||
zend_multibyte_fetch_encoding(decode)
|
||||
) == (size_t)-1) {
|
||||
to,
|
||||
from) == (size_t)-1) {
|
||||
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
|
||||
}
|
||||
return len;
|
||||
@@ -2646,14 +2652,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
szValuePtr = szValuePtr+8;
|
||||
ByteCount -= 8;
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
to = zend_multibyte_fetch_encoding(ImageInfo->encode_jis);
|
||||
from = zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le);
|
||||
if (!to || !from || zend_multibyte_encoding_converter(
|
||||
(unsigned char**)pszInfoPtr,
|
||||
&len,
|
||||
(unsigned char*)szValuePtr,
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_jis),
|
||||
zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le)
|
||||
) == (size_t)-1) {
|
||||
to,
|
||||
from) == (size_t)-1) {
|
||||
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
|
||||
}
|
||||
return len;
|
||||
@@ -2709,8 +2716,14 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
char *dir_start;
|
||||
|
||||
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type))
|
||||
return FALSE;
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "No maker note data found. Detected maker: %s (length = %d)", ImageInfo->make, strlen(ImageInfo->make));
|
||||
#endif
|
||||
/* unknown manufacturer, not an error, use it as a string */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
maker_note = maker_note_array+i;
|
||||
|
||||
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/
|
||||
@@ -2723,6 +2736,12 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
break;
|
||||
}
|
||||
|
||||
if (maker_note->offset >= value_len) {
|
||||
/* Do not go past the value end */
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dir_start = value_ptr + maker_note->offset;
|
||||
|
||||
#ifdef EXIF_DEBUG
|
||||
@@ -2751,10 +2770,19 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
offset_base = value_ptr;
|
||||
break;
|
||||
case MN_OFFSET_GUESS:
|
||||
if (maker_note->offset + 10 + 4 >= value_len) {
|
||||
/* Can not read dir_start+10 since it's beyond value end */
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X", value_len);
|
||||
return FALSE;
|
||||
}
|
||||
offset_diff = 2 + NumDirEntries*12 + 4 - php_ifd_get32u(dir_start+10, ImageInfo->motorola_intel);
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Using automatic offset correction: 0x%04X", ((int)dir_start-(int)offset_base+maker_note->offset+displacement) + offset_diff);
|
||||
#endif
|
||||
if (offset_diff < 0 || offset_diff >= value_len ) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data bad offset: 0x%04X length 0x%04X", offset_diff, value_len);
|
||||
return FALSE;
|
||||
}
|
||||
offset_base = value_ptr + offset_diff;
|
||||
break;
|
||||
default:
|
||||
@@ -2763,7 +2791,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
}
|
||||
|
||||
if ((2+NumDirEntries*12) > value_len) {
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + x%04X*12 = x%04X > x%04X", NumDirEntries, 2+NumDirEntries*12, value_len);
|
||||
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + 0x%04X*12 = 0x%04X > 0x%04X", NumDirEntries, 2+NumDirEntries*12, value_len);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2869,11 +2897,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
}
|
||||
|
||||
fpos = php_stream_tell(ImageInfo->infile);
|
||||
php_stream_seek(ImageInfo->infile, offset_val, SEEK_SET);
|
||||
php_stream_seek(ImageInfo->infile, displacement+offset_val, SEEK_SET);
|
||||
fgot = php_stream_tell(ImageInfo->infile);
|
||||
if (fgot!=offset_val) {
|
||||
if (fgot!=displacement+offset_val) {
|
||||
EFREE_IF(outside);
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Wrong file pointer: 0x%08X != 0x%08X", fgot, offset_val);
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Wrong file pointer: 0x%08X != 0x%08X", fgot, displacement+offset_val);
|
||||
return FALSE;
|
||||
}
|
||||
fgot = php_stream_read(ImageInfo->infile, value_ptr, byte_count);
|
||||
@@ -3049,7 +3077,10 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
break;
|
||||
|
||||
case TAG_MAKER_NOTE:
|
||||
exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement);
|
||||
if (!exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement)) {
|
||||
EFREE_IF(outside);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case TAG_EXIF_IFD_POINTER:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 785 KiB |
@@ -0,0 +1,140 @@
|
||||
--TEST--
|
||||
Bug #50845 (exif_read_data() returns corrupted exif headers)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/bug50845.jpg';
|
||||
var_dump(exif_read_data($infile));
|
||||
--EXPECTF--
|
||||
array(44) {
|
||||
["FileName"]=>
|
||||
string(12) "bug50845.jpg"
|
||||
["FileDateTime"]=>
|
||||
int(%d)
|
||||
["FileSize"]=>
|
||||
int(803603)
|
||||
["FileType"]=>
|
||||
int(2)
|
||||
["MimeType"]=>
|
||||
string(10) "image/jpeg"
|
||||
["SectionsFound"]=>
|
||||
string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF"
|
||||
["COMPUTED"]=>
|
||||
array(9) {
|
||||
["html"]=>
|
||||
string(26) "width="5472" height="3648""
|
||||
["Height"]=>
|
||||
int(3648)
|
||||
["Width"]=>
|
||||
int(5472)
|
||||
["IsColor"]=>
|
||||
int(1)
|
||||
["ByteOrderMotorola"]=>
|
||||
int(0)
|
||||
["ApertureFNumber"]=>
|
||||
string(5) "f/7.1"
|
||||
["Copyright"]=>
|
||||
string(13) "Public Domain"
|
||||
["Thumbnail.FileType"]=>
|
||||
int(2)
|
||||
["Thumbnail.MimeType"]=>
|
||||
string(10) "image/jpeg"
|
||||
}
|
||||
["ImageDescription"]=>
|
||||
string(295) "A U.S. Marine Corps MV-22 Osprey lands on the USS Whidbey Island (LSD-41), May 5, 2016. The vehicles were loaded to support a theater security cooperation event as a part of a MEU readiness exercise. (U.S. Marine Corps photo by Lance Cpl. Koby I. Saunders/22 Marine Expeditionary Unit/ Released)"
|
||||
["Make"]=>
|
||||
string(5) "Canon"
|
||||
["Model"]=>
|
||||
string(22) "Canon EOS-1D X Mark II"
|
||||
["Orientation"]=>
|
||||
int(1)
|
||||
["XResolution"]=>
|
||||
string(5) "240/1"
|
||||
["YResolution"]=>
|
||||
string(5) "240/1"
|
||||
["ResolutionUnit"]=>
|
||||
int(2)
|
||||
["Artist"]=>
|
||||
string(24) "Lance Cpl. Koby Saunders"
|
||||
["Copyright"]=>
|
||||
string(13) "Public Domain"
|
||||
["Exif_IFD_Pointer"]=>
|
||||
int(12572)
|
||||
["THUMBNAIL"]=>
|
||||
array(6) {
|
||||
["Compression"]=>
|
||||
int(6)
|
||||
["XResolution"]=>
|
||||
string(5) "240/1"
|
||||
["YResolution"]=>
|
||||
string(5) "240/1"
|
||||
["ResolutionUnit"]=>
|
||||
int(2)
|
||||
["JPEGInterchangeFormat"]=>
|
||||
int(860)
|
||||
["JPEGInterchangeFormatLength"]=>
|
||||
int(11204)
|
||||
}
|
||||
["ExposureTime"]=>
|
||||
string(5) "1/200"
|
||||
["FNumber"]=>
|
||||
string(5) "71/10"
|
||||
["ExposureProgram"]=>
|
||||
int(1)
|
||||
["ISOSpeedRatings"]=>
|
||||
int(100)
|
||||
["UndefinedTag:0x8830"]=>
|
||||
int(2)
|
||||
["UndefinedTag:0x8832"]=>
|
||||
int(100)
|
||||
["ExifVersion"]=>
|
||||
string(4) "0230"
|
||||
["ShutterSpeedValue"]=>
|
||||
string(15) "7643856/1000000"
|
||||
["ApertureValue"]=>
|
||||
string(15) "5655638/1000000"
|
||||
["ExposureBiasValue"]=>
|
||||
string(3) "0/1"
|
||||
["MaxApertureValue"]=>
|
||||
string(3) "4/1"
|
||||
["MeteringMode"]=>
|
||||
int(5)
|
||||
["Flash"]=>
|
||||
int(16)
|
||||
["FocalLength"]=>
|
||||
string(4) "24/1"
|
||||
["ColorSpace"]=>
|
||||
int(65535)
|
||||
["FocalPlaneXResolution"]=>
|
||||
string(12) "5472000/1438"
|
||||
["FocalPlaneYResolution"]=>
|
||||
string(11) "3648000/958"
|
||||
["FocalPlaneResolutionUnit"]=>
|
||||
int(2)
|
||||
["CustomRendered"]=>
|
||||
int(0)
|
||||
["ExposureMode"]=>
|
||||
int(1)
|
||||
["WhiteBalance"]=>
|
||||
int(0)
|
||||
["SceneCaptureType"]=>
|
||||
int(0)
|
||||
["UndefinedTag:0xA431"]=>
|
||||
string(12) "002099000358"
|
||||
["UndefinedTag:0xA432"]=>
|
||||
array(4) {
|
||||
[0]=>
|
||||
string(4) "24/1"
|
||||
[1]=>
|
||||
string(5) "105/1"
|
||||
[2]=>
|
||||
string(3) "0/0"
|
||||
[3]=>
|
||||
string(3) "0/0"
|
||||
}
|
||||
["UndefinedTag:0xA434"]=>
|
||||
string(22) "EF24-105mm f/4L IS USM"
|
||||
["UndefinedTag:0xA435"]=>
|
||||
string(10) "000044bc4c"
|
||||
}
|
||||
@@ -13,8 +13,4 @@ exif_read_data(__DIR__ . '/bug54002_2.jpeg');
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug54002_1.jpeg): Process tag(x0205=UndefinedTa): Illegal byte_count in %sbug54002.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug54002_1.jpeg): Process tag(xA000=FlashPixVer): Illegal pointer offset(%s) in %sbug54002.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug54002_2.jpeg): Process tag(x0205=UndefinedTa): Illegal byte_count in %sbug54002.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug54002_2.jpeg): Process tag(xA000=FlashPixVer): Illegal pointer offset(%s) in %sbug54002.php on line %d
|
||||
Warning: exif_read_data(bug54002_2.jpeg): Process tag(x0205=UndefinedTa): Illegal byte_count in %sbug54002.php on line %d
|
||||
@@ -10,7 +10,9 @@ echo "Test\n";
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Test
|
||||
int(76)
|
||||
|
||||
Warning: exif_read_data(bug62523_2.jpg): IFD data bad offset: 0xADB23672 length 0x0D94 in %s%ebug62523_2.php on line %d
|
||||
int(30)
|
||||
Done
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(count(exif_read_data(dirname(__FILE__) . "/bug72603.jpeg")));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug72603.jpeg): %s in %s%ebug72603.php on line %d
|
||||
int(%d)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug 72618 (NULL Pointer Dereference in exif_process_user_comment)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(count(exif_read_data(dirname(__FILE__) . "/bug72618.jpg")));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(bug72618.jpg): %s in %s%ebug72618.php on line %d
|
||||
int(%d)
|
||||
@@ -779,6 +779,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_PRIV_RANGE) {
|
||||
if (
|
||||
(ip[0] == 10) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
|
||||
(ip[0] == 192 && ip[1] == 168)
|
||||
) {
|
||||
@@ -789,10 +790,18 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_RES_RANGE) {
|
||||
if (
|
||||
(ip[0] == 0) ||
|
||||
(ip[0] == 10) ||
|
||||
(ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
|
||||
(ip[0] == 127) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
|
||||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 0) ||
|
||||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 2) ||
|
||||
(ip[0] == 127 && ip[1] == 0 && ip[2] == 0 && ip[3] == 1) ||
|
||||
(ip[0] == 192 && ip[1] == 88 && ip[2] == 99) ||
|
||||
(ip[0] == 192 && ip[1] == 168) ||
|
||||
(ip[0] == 198 && (ip[1] == 18 || ip[1] == 19)) ||
|
||||
(ip[0] == 198 && ip[1] == 51 && ip[2] == 100) ||
|
||||
(ip[0] == 203 && ip[1] == 0 && ip[2] == 113) ||
|
||||
(ip[0] >= 224 && ip[0] <= 255)
|
||||
) {
|
||||
RETURN_VALIDATION_FAILED
|
||||
|
||||
@@ -41,7 +41,7 @@ string(9) "127.0.0.1"
|
||||
bool(false)
|
||||
string(12) "192.0.34.166"
|
||||
bool(false)
|
||||
string(9) "192.0.0.1"
|
||||
bool(false)
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "192.0.34.166"
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
--TEST--
|
||||
Bug #71745 FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8 range
|
||||
--FILE--
|
||||
<?php
|
||||
//https://tools.ietf.org/html/rfc6890#section-2.1
|
||||
|
||||
$privateRanges = array();
|
||||
// 10.0.0.0/8
|
||||
$privateRanges['10.0.0.0/8'] = array('10.0.0.0', '10.255.255.255');
|
||||
|
||||
// 169.254.0.0/16
|
||||
$privateRanges['168.254.0.0/16'] = array('169.254.0.0', '169.254.255.255');
|
||||
|
||||
// 172.16.0.0/12
|
||||
$privateRanges['172.16.0.0/12'] = array('172.16.0.0', '172.31.0.0');
|
||||
|
||||
// 192.168.0.0/16
|
||||
$privateRanges['192.168.0.0/16'] = array('192.168.0.0', '192.168.255.255');
|
||||
|
||||
foreach ($privateRanges as $key => $range) {
|
||||
list($min, $max) = $range;
|
||||
var_dump($key);
|
||||
var_dump(filter_var($min, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE));
|
||||
var_dump(filter_var($max, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE));
|
||||
}
|
||||
|
||||
$reservedRanges = array();
|
||||
|
||||
// 0.0.0.0/8
|
||||
$reserverRanges['0.0.0.0/8'] = array('0.0.0.0', '0.255.255.255');
|
||||
|
||||
// 10.0.0.0/8
|
||||
$reserverdRanges['10.0.0.0/8'] = array('10.0.0.0', '10.255.255.255');
|
||||
|
||||
// 100.64.0.0/10
|
||||
$reserverdRanges['10.64.0.0/10'] = array('100.64.0.0', '100.127.255.255');
|
||||
|
||||
// 127.0.0.0/8
|
||||
$reserverdRanges['127.0.0.0/8'] = array('127.0.0.0', '127.255.255.255');
|
||||
|
||||
// 169.254.0.0/16
|
||||
$reserverdRanges['169.254.0.0/16'] = array('169.254.0.0', '169.254.255.255');
|
||||
|
||||
// 172.16.0.0/12
|
||||
$reserverdRanges['172.16.0.0/12'] = array('172.16.0.0', '172.31.0.0');
|
||||
|
||||
// 192.0.0.0/24
|
||||
$reserverdRanges['192.0.0.0/24'] = array('192.0.0.0', '192.0.0.255');
|
||||
|
||||
// 192.0.0.0/29
|
||||
$reserverdRanges['192.0.0.0/29'] = array('192.0.0.0', '192.0.0.7');
|
||||
|
||||
// 192.0.2.0/24
|
||||
$reserverdRanges['192.0.2.0/24'] = array('192.0.2.0', '192.0.2.255');
|
||||
|
||||
// 198.18.0.0/15
|
||||
$reserverdRanges['198.18.0.0/15'] = array('198.18.0.0', '198.19.255.255');
|
||||
|
||||
// 198.51.100.0/24
|
||||
$reserverdRanges['198.51.100.0/24'] = array('198.51.100.0', '198.51.100.255');
|
||||
|
||||
// 192.88.99.0/24
|
||||
$reserverdRanges['192.88.99.0/24'] = array('192.88.99.0', '192.88.99.255');
|
||||
|
||||
// 192.168.0.0/16
|
||||
$reserverdRanges['192.168.0.0/16'] = array('192.168.0.0', '192.168.255.255');
|
||||
|
||||
// 203.0.113.0/24
|
||||
$reserverdRanges['203.0.113.0/24'] = array('203.0.113.0', '203.0.113.255');
|
||||
|
||||
// 240.0.0.0/4 + 255.255.255.255/32
|
||||
$reserverdRanges['240.0.0.0/4'] = array('224.0.0.0', '255.255.255.255');
|
||||
|
||||
foreach ($reserverdRanges as $key => $range) {
|
||||
list($min, $max) = $range;
|
||||
var_dump($key);
|
||||
var_dump(filter_var($min, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var($max, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_RES_RANGE));
|
||||
}
|
||||
|
||||
|
||||
|
||||
--EXPECT--
|
||||
string(10) "10.0.0.0/8"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(14) "168.254.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(13) "172.16.0.0/12"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(14) "192.168.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(10) "10.0.0.0/8"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "10.64.0.0/10"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(11) "127.0.0.0/8"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(14) "169.254.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(13) "172.16.0.0/12"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "192.0.0.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "192.0.0.0/29"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(12) "192.0.2.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(13) "198.18.0.0/15"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(15) "198.51.100.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(14) "192.88.99.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(14) "192.168.0.0/16"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(14) "203.0.113.0/24"
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(11) "240.0.0.0/4"
|
||||
bool(false)
|
||||
bool(false)
|
||||
+47
-46
@@ -1,48 +1,49 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIBmzCCAQQCAQAwWzELMAkGA1UEBhMCUFQxCzAJBgNVBAgTAkx4MQswCQYDVQQH
|
||||
EwJMeDEcMBoGA1UEChMTQSBtaW5oYSBlbXByZXNhLCBTQTEUMBIGA1UECxMLUEhQ
|
||||
IFFBIFRlYW0wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM9mfEOSYwXf58ch
|
||||
4NyO1QOU1XMfquz8OVpvMUITABLAevZpeQn6vZPHNyXHFQC0QC8scydK1rAYd2U+
|
||||
9K2aPub6ioMjYyjPpAE07l9EAAPUEBlqqsziB/wT8QjWkByyJEkYu+o0Wyjokhfn
|
||||
BMPvm52wLWUx9nvUeNDCftnKg1wxAgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQDD
|
||||
s1FeqPxnF2bWj8/dG8MyPaRfOAMVz1UsCZUciXIVG5LSIvR2qnMC3iEYt3s13sEq
|
||||
z8VJlNHa8nniE+VFNv093yIu+PlWXMEvb5y5EFqP2AYq3RAT+SJsSxGqIdzPZiKY
|
||||
INaktLCZmQ/E1v7/4hFzVRq9ydJI82DVS1nv282Whw==
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC4zCCAkygAwIBAgIBADANBgkqhkiG9w0BAQQFADBbMQswCQYDVQQGEwJQVDEL
|
||||
MAkGA1UECBMCTHgxCzAJBgNVBAcTAkx4MRwwGgYDVQQKExNBIG1pbmhhIGVtcHJl
|
||||
c2EsIFNBMRQwEgYDVQQLEwtQSFAgUUEgVGVhbTAeFw0wNjExMTkxODIzNTNaFw0w
|
||||
NzExMTkxODIzNTNaMFsxCzAJBgNVBAYTAlBUMQswCQYDVQQIEwJMeDELMAkGA1UE
|
||||
BxMCTHgxHDAaBgNVBAoTE0EgbWluaGEgZW1wcmVzYSwgU0ExFDASBgNVBAsTC1BI
|
||||
UCBRQSBUZWFtMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPZnxDkmMF3+fH
|
||||
IeDcjtUDlNVzH6rs/DlabzFCEwASwHr2aXkJ+r2TxzclxxUAtEAvLHMnStawGHdl
|
||||
PvStmj7m+oqDI2Moz6QBNO5fRAAD1BAZaqrM4gf8E/EI1pAcsiRJGLvqNFso6JIX
|
||||
5wTD75udsC1lMfZ71HjQwn7ZyoNcMQIDAQABo4G2MIGzMB0GA1UdDgQWBBTIga5L
|
||||
q+Ub1SWXgNZRYCpq3c8Z+jCBgwYDVR0jBHwweoAUyIGuS6vlG9Ull4DWUWAqat3P
|
||||
GfqhX6RdMFsxCzAJBgNVBAYTAlBUMQswCQYDVQQIEwJMeDELMAkGA1UEBxMCTHgx
|
||||
HDAaBgNVBAoTE0EgbWluaGEgZW1wcmVzYSwgU0ExFDASBgNVBAsTC1BIUCBRQSBU
|
||||
ZWFtggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAe6AA8aC3KDI8
|
||||
smd+7XWjaTSp1Q0uMkEZ2PEBzif2I1aPPqw1CQykJ1iDdC/8PJ1yEIezloP2XQoZ
|
||||
NjTaCO+uubay03ncoPTZvDUwExN9BYFAYgc2z3tLMHYbA7kM2sIbKys7ZQegLibr
|
||||
TSKYQOBeYA/FB9GHECJGU3zBRvYi+Og=
|
||||
MIIDhTCCAm2gAwIBAgIJAN75FFz+owOAMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV
|
||||
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
|
||||
aWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMMCTEyNy4wLjAuMTAeFw0xNjA3MjUxMjM3
|
||||
MTJaFw0yNjA3MjMxMjM3MTJaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21l
|
||||
LVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNV
|
||||
BAMMCTEyNy4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtG
|
||||
AIrNUDItISfpAqztL2TFEWEHLGTzCEh5Ag2sdMD7UYbqIPHLOE4EINv+dqEMM0Nz
|
||||
LYnw7ChtVegXT907xCaQcmeDFSdhqze4L8zawDfnn4syB8XAwGYJfpstYwe3nO6+
|
||||
0WvLSb1A5TYNeyoXjwlAUKElxkeWAo51uhR41GDhDQ9GgpqX1ccAhmSoUhgIRSzf
|
||||
6f4KE3WTdzl1p12ZtkYHB8Jo2jB/JXnwGOz6isLnpRvkex4B7sUX+7u1MqK/e1X7
|
||||
Hi1G/VkaAfC2SOfjTePtGBDBXrQ1arYXDPRA04sgFzSh55l7lC/4HasQ/jAb3h95
|
||||
dcEIqyc69iioaN1c1NcCAwEAAaNQME4wHQYDVR0OBBYEFNv3kefb1H+6/6CpjiBi
|
||||
+I2s9E90MB8GA1UdIwQYMBaAFNv3kefb1H+6/6CpjiBi+I2s9E90MAwGA1UdEwQF
|
||||
MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIzSEWpHSaBs7KduBRXX5+qFxBN6OCPl
|
||||
7ID0rxAOYfw7ruzbmwgOpBgMIHGn+KqA6CmQI0jh9bZbv5TV2aFpFsUihugPc2lW
|
||||
5EshCozxlEPmIJNsO8jDqPE4w3m4KiVTscRWjBa5cco+lwLDqboerm2l7vvrtr6B
|
||||
pgLaZct1c73MouvoJSCGK5EOGW7jsgaxjxJ3UZug+24Ko1wulO2cgBLhda9Ilrnx
|
||||
CIKI9h8Z2WVWuVQfyCyO1g7XkJgkBec77OhxD+m4onzPY6waqnnhmFOBcS+gKgBV
|
||||
jHeK9DCvZ9zet3EyEp6fyQOOtsC+gU0piYgfsQL7aCp5oLe+fjTiuUY=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,928762DB6DE222AD
|
||||
|
||||
oOxNUBX0wrqmRqb3IEZMogc1bnVm6JoW6YFjGfHNcIz0jS7UPDhUFDR26y0dYujL
|
||||
LEgxOcYo8ItvGcXSRbs+3W7lISbosgkB0DOaKx5jVmOGwUVRergUUSY8rbf93FtP
|
||||
27CEvAfsU6do5HmlJ34mYZW1k+onCznlJXJkupQ5jmiily3GwEdr/5mMIVOmXQ6p
|
||||
xWkxHySDKyVbR0v4JY3SJLRBuhgofYNG5155PiqZ7KwYY4Aw60eVgINsvJCF9/8b
|
||||
kEj+lecHbBdAf7N82320Ga+F+VeFnUl0gWFjoIF9UFCO80+7ZvIGdGlyPkr4zMvt
|
||||
TsC1snJQdHg+IlT3sGayYrQANpTG6GPYhn3KEvK5aqq+bPEe5lija0gw34jbPCo+
|
||||
TjHR76lToxzubGZODyyF/rjl5KwUbqTCNuv1PX1jTx7n7sCbu+KHpqXMhTHLKtby
|
||||
+Wh7WAfsVrbIW+P85/mkfhPbPZ2621f9cyStdFGgWU4dHdD00HIGOgAJvUSbC2Au
|
||||
oVUoKf2818t1s9aA4ptog04sNi+Ixu+z+3yYNLZj51j4ZX3KuXxLIiQvlvFQ8LQi
|
||||
RHGQk3u2W3iNtDKKUQjMPaB2FlVtC7FmtHBCpRmos6ld240DDyucqMdIDTMaqV0+
|
||||
sL4X+LIeBM/hP/IquRTuQBHBmgjkN4845ihTUJOanyKx605ANq/roHzXrbIxhR5p
|
||||
pcJLCBMLMWgdOCJMZRavSq04iXeNfP6Mk/joVpHS62Ljdfc94BBLfsOKOErA20Nq
|
||||
lfvbZqy2tI5IIDoq05S8FU0DYNqq/hyrv9Udo8IAo+WkBOABm0x/WA==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC7RgCKzVAyLSEn
|
||||
6QKs7S9kxRFhByxk8whIeQINrHTA+1GG6iDxyzhOBCDb/nahDDNDcy2J8OwobVXo
|
||||
F0/dO8QmkHJngxUnYas3uC/M2sA355+LMgfFwMBmCX6bLWMHt5zuvtFry0m9QOU2
|
||||
DXsqF48JQFChJcZHlgKOdboUeNRg4Q0PRoKal9XHAIZkqFIYCEUs3+n+ChN1k3c5
|
||||
daddmbZGBwfCaNowfyV58Bjs+orC56Ub5HseAe7FF/u7tTKiv3tV+x4tRv1ZGgHw
|
||||
tkjn403j7RgQwV60NWq2Fwz0QNOLIBc0oeeZe5Qv+B2rEP4wG94feXXBCKsnOvYo
|
||||
qGjdXNTXAgMBAAECggEAD7yDISa9fWnjZlojGmrX16zjl/alWVo+sPBSJtn9+ZVk
|
||||
tWSJHihIc+3O4Q2R5FiFGj7cbcHr5j3BwT3sPRfflKoAowgVx/hiDc2RXrJnAouZ
|
||||
EXZDxu86e5iCpgF7V9OrATjRmjA74wZH/HHHjrLqFwnrfI8TCULmthfYag35Mqax
|
||||
qrIEzvSuYdaGxblNe+ZfnVEDW2F9DLBGcma0ffUlJp8AvV7bpo8Rj/JovPxit/VS
|
||||
UdwSRxwSAugctFpmcGlFkoQfxUx1WdEy8hjopLrayMjCCJvRUL4+C4zT9r9PBHOj
|
||||
fCSbJ+ajQIoRrgaL9bURk8BFMHY8+yMUsWEYVSmFAQKBgQDtOvPkhvZsNocUB5nJ
|
||||
ti3SXyDQ6OZQuKKHPSeDV/EvmZKeNlrQ1ZnwXLP3vkcedDOkt1nEVq/hUewpjt08
|
||||
2MvmMwJBQEnmbTzMf43DtlXsStdP1lhYaFbU4iMM5zRfyBHDu1GPZEPXvKKpJUk0
|
||||
M+jYIyTAP3mcZhqDKn0mPVP7VwKBgQDKFy9DtWFKxCvhFQvHx7YeZiVWJbIst/O4
|
||||
ZyuPVAErni0hzSeCkmm7+F9hgEdPSLRcSaeTWP4L0u1cixECKboIhoNs38aft7o3
|
||||
MdnI2RDSEKtKX2uVuhvpGDNuGpBAc8Qu8iCiv5INSC36ZhD1h++O/TiiUdgRJ3yX
|
||||
yeG7ej+CgQKBgCR5F95e0aw5hfMSaBaXJ9xcO9Niu2ZVvMdGI7kR4EcNOXmRqczJ
|
||||
ym0mE5VXb9/Cxd3hQq/pFAl0avbIvEMKoe62kPYvSC1hRiO6yLT6Z6N4rjncHqEZ
|
||||
CaCZVAI72dWQEQsi1ZtSMwwMOIYA8YxRHs98N75HBA+DszfPZIZoj2zpAoGBAJHp
|
||||
B3ElhmeLF/tdTLIj2bQ9H/wBH5H2Bvw/UU4c4vNxMzjSfRJjUAAtpgAptFLkNYTk
|
||||
kR9sA5DZ7BMDPXaIVg9Nv5peP3SWHNc5IPtI7kIdUu9R0cW7J+e2V3vJphlC/ITA
|
||||
wRuAoZ0BXmEKTHhae3aMEdXwrcZE8kpNsrO/4hcBAoGBAMISiPJPuxAX1UtqcxTa
|
||||
mDJfnQ2gxRu6AK9VmXqo0X4IBxDSnTjcL0huUlS849wgsE5oTXgdYb2hn+TXM5JJ
|
||||
NsEXLhV09X1mrk4M4LV1npd0mYxvFsO4+p+IX5YLiahInmQtq0gx3DWE8wouVFER
|
||||
4yzfp27z8MZT8Qvr/ZI9lzWd
|
||||
-----END PRIVATE KEY-----
|
||||
+29
-11
@@ -2,7 +2,7 @@
|
||||
|
||||
$socket = null;
|
||||
$errno = 0;
|
||||
$context = stream_context_create(array('ssl' => array('local_cert' => dirname(__FILE__).'/cert.pem', 'passphrase' => 'pass')));
|
||||
$context = stream_context_create(array('ssl' => array('local_cert' => dirname(__FILE__).'/cert.pem')));
|
||||
|
||||
for ($i=0; $i<10 && !$socket; ++$i) {
|
||||
$port = rand(50000, 65535);
|
||||
@@ -265,7 +265,7 @@ if ($pid) {
|
||||
|
||||
} elseif (preg_match("~^NLST(?: ([A-Za-z./]+))?\r\n$~", $buf, $m)) {
|
||||
|
||||
if (isset($m[1]) && $m[1] === 'bogusdir') {
|
||||
if (isset($m[1]) && (($m[1] === 'bogusdir') || ($m[1] === '/bogusdir'))) {
|
||||
fputs($s, "250 $m[1]: No such file or directory\r\n");
|
||||
continue;
|
||||
}
|
||||
@@ -276,13 +276,18 @@ if ($pid) {
|
||||
continue;
|
||||
}
|
||||
|
||||
fputs($s, "150 File status okay; about to open data connection\r\n");
|
||||
|
||||
if (!$fs = stream_socket_client("tcp://$host:$port")) {
|
||||
fputs($s, "425 Can't open data connection\r\n");
|
||||
continue;
|
||||
if (empty($pasv)) {
|
||||
fputs($s, "150 File status okay; about to open data connection\r\n");
|
||||
if (!$fs = stream_socket_client("tcp://$host:$port")) {
|
||||
fputs($s, "425 Can't open data connection\r\n");
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
fputs($s, "125 Data connection already open; transfer starting.\r\n");
|
||||
$fs=$pasvs;
|
||||
}
|
||||
|
||||
|
||||
if (empty($m[1]) || $m[1] !== 'emptydir') {
|
||||
fputs($fs, "file1\r\nfile1\r\nfile\nb0rk\r\n");
|
||||
}
|
||||
@@ -368,7 +373,7 @@ if ($pid) {
|
||||
}
|
||||
fputs($s, "226 Closing data Connection.\r\n");
|
||||
break;
|
||||
case "mediumfile":
|
||||
case "mediumfile":
|
||||
fputs($s, "150 File status okay; about to open data connection.\r\n");
|
||||
for($i = 0; $i < 150; $i++){
|
||||
fputs($fs, "This is line $i of the test data.\n");
|
||||
@@ -384,13 +389,26 @@ if ($pid) {
|
||||
|
||||
|
||||
}elseif (preg_match('/^PASV/', $buf, $matches)) {
|
||||
$port = $pasv_port;
|
||||
$p2 = $port % ((int) 1 << 8);
|
||||
$p1 = ($port-$p2)/((int) 1 << 8);
|
||||
$pasv=true;
|
||||
$p2 = $pasv_port % ((int) 1 << 8);
|
||||
$p1 = ($pasv_port-$p2)/((int) 1 << 8);
|
||||
$host = "127.0.0.1";
|
||||
if (!empty($ssl)) {
|
||||
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
|
||||
} else {
|
||||
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port");
|
||||
}
|
||||
|
||||
fputs($s, "227 Entering Passive Mode. (127,0,0,1,{$p1},{$p2})\r\n");
|
||||
|
||||
$pasvs = stream_socket_accept($soc,10);
|
||||
|
||||
if ((!empty($ssl)) && (!stream_socket_enable_crypto($pasvs, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER))) {
|
||||
die("SSLv23 handshake failed.\n");
|
||||
}
|
||||
|
||||
}elseif (preg_match('/^EPSV/', $buf, $matches)) {
|
||||
fputs($s, "550 Extended passsive mode not supported.\r\n");
|
||||
} elseif (preg_match('/^SITE EXEC/', $buf, $matches)) {
|
||||
fputs($s, "200 OK\r\n");
|
||||
|
||||
|
||||
+22
-3
@@ -63,6 +63,9 @@
|
||||
static int le_gd, le_gd_font;
|
||||
|
||||
#include <gd.h>
|
||||
#ifndef HAVE_GD_BUNDLED
|
||||
# include <gd_errors.h>
|
||||
#endif
|
||||
#include <gdfontt.h> /* 1 Tiny font */
|
||||
#include <gdfonts.h> /* 2 Small font */
|
||||
#include <gdfontmb.h> /* 3 Medium bold font */
|
||||
@@ -1021,7 +1024,19 @@ static void php_free_gd_font(zend_resource *rsrc)
|
||||
void php_gd_error_method(int type, const char *format, va_list args)
|
||||
{
|
||||
|
||||
php_verror(NULL, "", type, format, args);
|
||||
switch (type) {
|
||||
case GD_DEBUG:
|
||||
case GD_INFO:
|
||||
case GD_NOTICE:
|
||||
type = E_NOTICE;
|
||||
break;
|
||||
case GD_WARNING:
|
||||
type = E_WARNING;
|
||||
break;
|
||||
default:
|
||||
type = E_ERROR;
|
||||
}
|
||||
php_verror(NULL, "", type, format, args TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
@@ -1047,6 +1062,7 @@ PHP_MINIT_FUNCTION(gd)
|
||||
REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("IMG_WEBP", 32, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
/* special colours for gd */
|
||||
REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT);
|
||||
@@ -2124,6 +2140,9 @@ PHP_FUNCTION(imagetypes)
|
||||
#if defined(HAVE_GD_XPM)
|
||||
ret |= 16;
|
||||
#endif
|
||||
#ifdef HAVE_GD_WEBP
|
||||
ret |= 32;
|
||||
#endif
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
@@ -4617,8 +4636,8 @@ PHP_FUNCTION(imagecropauto)
|
||||
break;
|
||||
|
||||
case GD_CROP_THRESHOLD:
|
||||
if (color < 0) {
|
||||
php_error_docref(NULL, E_WARNING, "Color argument missing with threshold mode");
|
||||
if (color < 0 || (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
im_crop = gdImageCropThreshold(im, color, (float) threshold);
|
||||
|
||||
+111
-28
@@ -131,6 +131,10 @@ gdImagePtr gdImageCreate (int sx, int sy)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (overflow2(sizeof(unsigned char *), sx)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
im = (gdImage *) gdCalloc(1, sizeof(gdImage));
|
||||
|
||||
/* Row-major ever since gd 1.3 */
|
||||
@@ -184,7 +188,7 @@ gdImagePtr gdImageCreateTrueColor (int sx, int sy)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (overflow2(sizeof(int), sx)) {
|
||||
if (overflow2(sizeof(int *), sx)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -593,15 +597,18 @@ void gdImageColorDeallocate (gdImagePtr im, int color)
|
||||
|
||||
void gdImageColorTransparent (gdImagePtr im, int color)
|
||||
{
|
||||
if (color < 0) {
|
||||
return;
|
||||
}
|
||||
if (!im->trueColor) {
|
||||
if((color >= im->colorsTotal)) {
|
||||
return;
|
||||
}
|
||||
/* Make the old transparent color opaque again */
|
||||
if (im->transparent != -1) {
|
||||
im->alpha[im->transparent] = gdAlphaOpaque;
|
||||
}
|
||||
if (color > -1 && color < im->colorsTotal && color < gdMaxColors) {
|
||||
im->alpha[color] = gdAlphaTransparent;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
im->alpha[color] = gdAlphaTransparent;
|
||||
}
|
||||
im->transparent = color;
|
||||
}
|
||||
@@ -1049,11 +1056,13 @@ void gdImageAABlend (gdImagePtr im)
|
||||
}
|
||||
}
|
||||
|
||||
static void _gdImageFilledHRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color);
|
||||
|
||||
static void gdImageHLine(gdImagePtr im, int y, int x1, int x2, int col)
|
||||
{
|
||||
if (im->thick > 1) {
|
||||
int thickhalf = im->thick >> 1;
|
||||
gdImageFilledRectangle(im, x1, y - thickhalf, x2, y + im->thick - thickhalf - 1, col);
|
||||
_gdImageFilledHRectangle(im, x1, y - thickhalf, x2, y + im->thick - thickhalf - 1, col);
|
||||
} else {
|
||||
if (x2 < x1) {
|
||||
int t = x2;
|
||||
@@ -1659,23 +1668,17 @@ long lsqrt (long n)
|
||||
/* s and e are integers modulo 360 (degrees), with 0 degrees
|
||||
being the rightmost extreme and degrees changing clockwise.
|
||||
cx and cy are the center in pixels; w and h are the horizontal
|
||||
and vertical diameter in pixels. Nice interface, but slow.
|
||||
See gd_arc_f_buggy.c for a better version that doesn't
|
||||
seem to be bug-free yet. */
|
||||
and vertical diameter in pixels. */
|
||||
|
||||
void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color)
|
||||
{
|
||||
if ((s % 360) == (e % 360)) {
|
||||
gdImageEllipse(im, cx, cy, w, h, color);
|
||||
} else {
|
||||
gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill);
|
||||
}
|
||||
gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill);
|
||||
}
|
||||
|
||||
void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style)
|
||||
{
|
||||
gdPoint pts[3];
|
||||
int i;
|
||||
gdPoint pts[363];
|
||||
int i, pti;
|
||||
int lx = 0, ly = 0;
|
||||
int fx = 0, fy = 0;
|
||||
|
||||
@@ -1703,7 +1706,7 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
|
||||
}
|
||||
}
|
||||
|
||||
for (i = s; i <= e; i++) {
|
||||
for (i = s, pti = 1; i <= e; i++, pti++) {
|
||||
int x, y;
|
||||
x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;
|
||||
y = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy;
|
||||
@@ -1712,19 +1715,28 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
|
||||
if (style & gdNoFill) {
|
||||
gdImageLine(im, lx, ly, x, y, color);
|
||||
} else {
|
||||
/* This is expensive! */
|
||||
pts[0].x = lx;
|
||||
pts[0].y = ly;
|
||||
pts[1].x = x;
|
||||
pts[1].y = y;
|
||||
pts[2].x = cx;
|
||||
pts[2].y = cy;
|
||||
gdImageFilledPolygon(im, pts, 3, color);
|
||||
}
|
||||
if (y == ly) {
|
||||
pti--; /* don't add this point */
|
||||
if (((i > 270 || i < 90) && x > lx) || ((i > 90 && i < 270) && x < lx)) {
|
||||
/* replace the old x coord, if increasing on the
|
||||
right side or decreasing on the left side */
|
||||
pts[pti].x = x;
|
||||
}
|
||||
} else {
|
||||
pts[pti].x = x;
|
||||
pts[pti].y = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fx = x;
|
||||
fy = y;
|
||||
if (!(style & (gdChord | gdNoFill))) {
|
||||
pts[0].x = cx;
|
||||
pts[0].y = cy;
|
||||
pts[pti].x = x;
|
||||
pts[pti].y = y;
|
||||
}
|
||||
}
|
||||
lx = x;
|
||||
ly = y;
|
||||
@@ -1751,6 +1763,10 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
|
||||
gdImageLine(im, cx, cy, lx, ly, color);
|
||||
gdImageLine(im, cx, cy, fx, fy, color);
|
||||
}
|
||||
} else {
|
||||
pts[pti].x = cx;
|
||||
pts[pti].y = cy;
|
||||
gdImageFilledPolygon(im, pts, pti+1, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1767,6 +1783,12 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!im->trueColor) {
|
||||
if ((color > (im->colorsTotal - 1)) || (border > (im->colorsTotal - 1)) || (color < 0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
restoreAlphaBlending = im->alphaBlendingFlag;
|
||||
im->alphaBlendingFlag = 0;
|
||||
|
||||
@@ -2112,10 +2134,53 @@ void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
}
|
||||
}
|
||||
|
||||
void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
static void _gdImageFilledHRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (x1 == x2 && y1 == y2) {
|
||||
gdImageSetPixel(im, x1, y1, color);
|
||||
return;
|
||||
}
|
||||
|
||||
if (x1 > x2) {
|
||||
x = x1;
|
||||
x1 = x2;
|
||||
x2 = x;
|
||||
}
|
||||
|
||||
if (y1 > y2) {
|
||||
y = y1;
|
||||
y1 = y2;
|
||||
y2 = y;
|
||||
}
|
||||
|
||||
if (x1 < 0) {
|
||||
x1 = 0;
|
||||
}
|
||||
|
||||
if (x2 >= gdImageSX(im)) {
|
||||
x2 = gdImageSX(im) - 1;
|
||||
}
|
||||
|
||||
if (y1 < 0) {
|
||||
y1 = 0;
|
||||
}
|
||||
|
||||
if (y2 >= gdImageSY(im)) {
|
||||
y2 = gdImageSY(im) - 1;
|
||||
}
|
||||
|
||||
for (x = x1; (x <= x2); x++) {
|
||||
for (y = y1; (y <= y2); y++) {
|
||||
gdImageSetPixel (im, x, y, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _gdImageFilledVRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (x1 == x2 && y1 == y2) {
|
||||
gdImageSetPixel(im, x1, y1, color);
|
||||
@@ -2157,6 +2222,11 @@ void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int
|
||||
}
|
||||
}
|
||||
|
||||
void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
_gdImageFilledVRectangle(im, x1, y1, x2, y2, color);
|
||||
}
|
||||
|
||||
void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h)
|
||||
{
|
||||
int c;
|
||||
@@ -2659,6 +2729,19 @@ void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
|
||||
maxy = p[i].y;
|
||||
}
|
||||
}
|
||||
/* necessary special case: horizontal line */
|
||||
if (n > 1 && miny == maxy) {
|
||||
x1 = x2 = p[0].x;
|
||||
for (i = 1; (i < n); i++) {
|
||||
if (p[i].x < x1) {
|
||||
x1 = p[i].x;
|
||||
} else if (p[i].x > x2) {
|
||||
x2 = p[i].x;
|
||||
}
|
||||
}
|
||||
gdImageLine(im, x1, miny, x2, miny, c);
|
||||
return;
|
||||
}
|
||||
pmaxy = maxy;
|
||||
/* 2.0.16: Optimization by Ilia Chipitsine -- don't waste time offscreen */
|
||||
if (miny < 0) {
|
||||
|
||||
@@ -138,11 +138,18 @@ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, in
|
||||
if (gd2_compressed(*fmt)) {
|
||||
nc = (*ncx) * (*ncy);
|
||||
GD2_DBG(php_gd_error("Reading %d chunk index entries", nc));
|
||||
if (overflow2(sizeof(t_chunk_info), nc)) {
|
||||
goto fail1;
|
||||
}
|
||||
sidx = sizeof(t_chunk_info) * nc;
|
||||
if (sidx <= 0) {
|
||||
goto fail1;
|
||||
}
|
||||
cidx = gdCalloc(sidx, 1);
|
||||
if (cidx == NULL) {
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
for (i = 0; i < nc; i++) {
|
||||
if (gdGetInt(&cidx[i].offset, in) != 1) {
|
||||
gdFree(cidx);
|
||||
|
||||
@@ -601,14 +601,26 @@ nomatch:
|
||||
* code in turn. When the buffer fills up empty it and start over.
|
||||
*/
|
||||
|
||||
static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F,
|
||||
static const unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F,
|
||||
0x001F, 0x003F, 0x007F, 0x00FF,
|
||||
0x01FF, 0x03FF, 0x07FF, 0x0FFF,
|
||||
0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
|
||||
|
||||
|
||||
/* Arbitrary value to mark output is done. When we see EOFCode, then we don't
|
||||
* expect to see any more data. If we do (e.g. corrupt image inputs), cur_bits
|
||||
* might be negative, so flag it to return early.
|
||||
*/
|
||||
#define CUR_BITS_FINISHED -1000
|
||||
|
||||
|
||||
static void
|
||||
output(code_int code, GifCtx *ctx)
|
||||
{
|
||||
if (ctx->cur_bits == CUR_BITS_FINISHED) {
|
||||
return;
|
||||
}
|
||||
|
||||
ctx->cur_accum &= masks[ ctx->cur_bits ];
|
||||
|
||||
if( ctx->cur_bits > 0 )
|
||||
@@ -655,8 +667,10 @@ output(code_int code, GifCtx *ctx)
|
||||
ctx->cur_bits -= 8;
|
||||
}
|
||||
|
||||
flush_char(ctx);
|
||||
/* Flag that it's done to prevent re-entry. */
|
||||
ctx->cur_bits = CUR_BITS_FINISHED;
|
||||
|
||||
flush_char(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -879,20 +879,42 @@ int getPixelInterpolated(gdImagePtr im, const double x, const double y, const in
|
||||
static inline LineContribType * _gdContributionsAlloc(unsigned int line_length, unsigned int windows_size)
|
||||
{
|
||||
unsigned int u = 0;
|
||||
LineContribType *res;
|
||||
LineContribType *res;
|
||||
int overflow_error = 0;
|
||||
|
||||
res = (LineContribType *) gdMalloc(sizeof(LineContribType));
|
||||
if (!res) {
|
||||
return NULL;
|
||||
}
|
||||
res->WindowSize = windows_size;
|
||||
res->LineLength = line_length;
|
||||
res->ContribRow = (ContributionType *) gdMalloc(line_length * sizeof(ContributionType));
|
||||
|
||||
for (u = 0 ; u < line_length ; u++) {
|
||||
res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double));
|
||||
}
|
||||
return res;
|
||||
res->WindowSize = windows_size;
|
||||
res->LineLength = line_length;
|
||||
if (overflow2(line_length, sizeof(ContributionType))) {
|
||||
gdFree(res);
|
||||
return NULL;
|
||||
}
|
||||
res->ContribRow = (ContributionType *) gdMalloc(line_length * sizeof(ContributionType));
|
||||
if (res->ContribRow == NULL) {
|
||||
gdFree(res);
|
||||
return NULL;
|
||||
}
|
||||
for (u = 0 ; u < line_length ; u++) {
|
||||
if (overflow2(windows_size, sizeof(double))) {
|
||||
overflow_error = 1;
|
||||
} else {
|
||||
res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double));
|
||||
}
|
||||
if (overflow_error == 1 || res->ContribRow[u].Weights == NULL) {
|
||||
unsigned int i;
|
||||
u--;
|
||||
for (i=0;i<=u;i++) {
|
||||
gdFree(res->ContribRow[i].Weights);
|
||||
}
|
||||
gdFree(res->ContribRow);
|
||||
gdFree(res);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static inline void _gdContributionsFree(LineContribType * p)
|
||||
@@ -907,59 +929,62 @@ static inline void _gdContributionsFree(LineContribType * p)
|
||||
|
||||
static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter)
|
||||
{
|
||||
double width_d;
|
||||
double scale_f_d = 1.0;
|
||||
const double filter_width_d = DEFAULT_BOX_RADIUS;
|
||||
double width_d;
|
||||
double scale_f_d = 1.0;
|
||||
const double filter_width_d = DEFAULT_BOX_RADIUS;
|
||||
int windows_size;
|
||||
unsigned int u;
|
||||
LineContribType *res;
|
||||
int overflow_error = 0;
|
||||
|
||||
if (scale_d < 1.0) {
|
||||
width_d = filter_width_d / scale_d;
|
||||
scale_f_d = scale_d;
|
||||
} else {
|
||||
width_d= filter_width_d;
|
||||
}
|
||||
if (scale_d < 1.0) {
|
||||
width_d = filter_width_d / scale_d;
|
||||
scale_f_d = scale_d;
|
||||
} else {
|
||||
width_d= filter_width_d;
|
||||
}
|
||||
|
||||
windows_size = 2 * (int)ceil(width_d) + 1;
|
||||
res = _gdContributionsAlloc(line_size, windows_size);
|
||||
|
||||
for (u = 0; u < line_size; u++) {
|
||||
const double dCenter = (double)u / scale_d;
|
||||
/* get the significant edge points affecting the pixel */
|
||||
register int iLeft = MAX(0, (int)floor (dCenter - width_d));
|
||||
int iRight = MIN((int)ceil(dCenter + width_d), (int)src_size - 1);
|
||||
double dTotalWeight = 0.0;
|
||||
windows_size = 2 * (int)ceil(width_d) + 1;
|
||||
res = _gdContributionsAlloc(line_size, windows_size);
|
||||
if (res == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
for (u = 0; u < line_size; u++) {
|
||||
const double dCenter = (double)u / scale_d;
|
||||
/* get the significant edge points affecting the pixel */
|
||||
register int iLeft = MAX(0, (int)floor (dCenter - width_d));
|
||||
int iRight = MIN((int)ceil(dCenter + width_d), (int)src_size - 1);
|
||||
double dTotalWeight = 0.0;
|
||||
int iSrc;
|
||||
|
||||
/* Cut edge points to fit in filter window in case of spill-off */
|
||||
if (iRight - iLeft + 1 > windows_size) {
|
||||
if (iLeft < ((int)src_size - 1 / 2)) {
|
||||
iLeft++;
|
||||
} else {
|
||||
iRight--;
|
||||
}
|
||||
}
|
||||
/* Cut edge points to fit in filter window in case of spill-off */
|
||||
if (iRight - iLeft + 1 > windows_size) {
|
||||
if (iLeft < ((int)src_size - 1 / 2)) {
|
||||
iLeft++;
|
||||
} else {
|
||||
iRight--;
|
||||
}
|
||||
}
|
||||
|
||||
res->ContribRow[u].Left = iLeft;
|
||||
res->ContribRow[u].Right = iRight;
|
||||
res->ContribRow[u].Left = iLeft;
|
||||
res->ContribRow[u].Right = iRight;
|
||||
|
||||
for (iSrc = iLeft; iSrc <= iRight; iSrc++) {
|
||||
dTotalWeight += (res->ContribRow[u].Weights[iSrc-iLeft] = scale_f_d * (*pFilter)(scale_f_d * (dCenter - (double)iSrc)));
|
||||
}
|
||||
for (iSrc = iLeft; iSrc <= iRight; iSrc++) {
|
||||
dTotalWeight += (res->ContribRow[u].Weights[iSrc-iLeft] = scale_f_d * (*pFilter)(scale_f_d * (dCenter - (double)iSrc)));
|
||||
}
|
||||
|
||||
if (dTotalWeight < 0.0) {
|
||||
_gdContributionsFree(res);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (dTotalWeight > 0.0) {
|
||||
for (iSrc = iLeft; iSrc <= iRight; iSrc++) {
|
||||
res->ContribRow[u].Weights[iSrc-iLeft] /= dTotalWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
if (dTotalWeight > 0.0) {
|
||||
for (iSrc = iLeft; iSrc <= iRight; iSrc++) {
|
||||
res->ContribRow[u].Weights[iSrc-iLeft] /= dTotalWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static inline void _gdScaleRow(gdImagePtr pSrc, unsigned int src_width, gdImagePtr dst, unsigned int dst_width, unsigned int row, LineContribType *contrib)
|
||||
@@ -1047,6 +1072,9 @@ static inline void _gdScaleVert (const gdImagePtr pSrc, const unsigned int src_w
|
||||
}
|
||||
|
||||
contrib = _gdContributionsCalc(dst_height, src_height, (double)(dst_height) / (double)(src_height), pSrc->interpolation);
|
||||
if (contrib == NULL) {
|
||||
return;
|
||||
}
|
||||
/* scale each column */
|
||||
for (u = 0; u < dst_width - 1; u++) {
|
||||
_gdScaleCol(pSrc, src_width, pDst, dst_width, dst_height, u, contrib);
|
||||
@@ -1241,7 +1269,13 @@ static gdImagePtr gdImageScaleBilinearPalette(gdImagePtr im, const unsigned int
|
||||
if (new_img == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
new_img->transparent = gdTrueColorAlpha(im->red[transparent], im->green[transparent], im->blue[transparent], im->alpha[transparent]);
|
||||
|
||||
if (transparent < 0) {
|
||||
/* uninitialized */
|
||||
new_img->transparent = -1;
|
||||
} else {
|
||||
new_img->transparent = gdTrueColorAlpha(im->red[transparent], im->green[transparent], im->blue[transparent], im->alpha[transparent]);
|
||||
}
|
||||
|
||||
for (i=0; i < _height; i++) {
|
||||
long j;
|
||||
@@ -1475,13 +1509,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co
|
||||
src_offset_y[0] = m;
|
||||
}
|
||||
|
||||
if (m < 1) {
|
||||
src_offset_x[1] = n;
|
||||
src_offset_y[1] = m;
|
||||
} else {
|
||||
src_offset_x[1] = n;
|
||||
src_offset_y[1] = m;
|
||||
}
|
||||
src_offset_x[1] = n;
|
||||
src_offset_y[1] = m;
|
||||
|
||||
if ((m < 1) || (n >= src_w - 1)) {
|
||||
src_offset_x[2] = n;
|
||||
@@ -1533,13 +1562,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co
|
||||
src_offset_y[8] = m;
|
||||
}
|
||||
|
||||
if (m >= src_h - 1) {
|
||||
src_offset_x[8] = n;
|
||||
src_offset_y[8] = m;
|
||||
} else {
|
||||
src_offset_x[9] = n;
|
||||
src_offset_y[9] = m;
|
||||
}
|
||||
src_offset_x[9] = n;
|
||||
src_offset_y[9] = m;
|
||||
|
||||
if ((m >= src_h-1) || (n >= src_w-1)) {
|
||||
src_offset_x[10] = n;
|
||||
@@ -1565,13 +1589,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co
|
||||
src_offset_y[12] = m;
|
||||
}
|
||||
|
||||
if (m >= src_h - 2) {
|
||||
src_offset_x[13] = n;
|
||||
src_offset_y[13] = m;
|
||||
} else {
|
||||
src_offset_x[13] = n;
|
||||
src_offset_y[13] = m;
|
||||
}
|
||||
src_offset_x[13] = n;
|
||||
src_offset_y[13] = m;
|
||||
|
||||
if ((m >= src_h - 2) || (n >= src_w - 1)) {
|
||||
src_offset_x[14] = n;
|
||||
@@ -1980,13 +1999,8 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
|
||||
src_offset_y[0] = m;
|
||||
}
|
||||
|
||||
if (m < 1) {
|
||||
src_offset_x[1] = n;
|
||||
src_offset_y[1] = m;
|
||||
} else {
|
||||
src_offset_x[1] = n;
|
||||
src_offset_y[1] = m ;
|
||||
}
|
||||
src_offset_x[1] = n;
|
||||
src_offset_y[1] = m;
|
||||
|
||||
if ((m < 1) || (n >= src_w-1)) {
|
||||
src_offset_x[2] = - 1;
|
||||
@@ -2039,8 +2053,8 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
|
||||
}
|
||||
|
||||
if (m >= src_h-1) {
|
||||
src_offset_x[8] = - 1;
|
||||
src_offset_y[8] = - 1;
|
||||
src_offset_x[9] = - 1;
|
||||
src_offset_y[9] = - 1;
|
||||
} else {
|
||||
src_offset_x[9] = n;
|
||||
src_offset_y[9] = m;
|
||||
|
||||
@@ -1329,7 +1329,7 @@ pass2_no_dither (j_decompress_ptr cinfo,
|
||||
/* If the pixel is transparent, we assign it the palette index that
|
||||
* will later be added at the end of the palette as the transparent
|
||||
* index. */
|
||||
if ((oim->transparent >= 0) && (oim->transparent == *(inptr - 1)))
|
||||
if ((oim->transparent >= 0) && (oim->transparent == *inptr))
|
||||
{
|
||||
*outptr++ = nim->colorsTotal;
|
||||
inptr++;
|
||||
|
||||
@@ -329,7 +329,7 @@ han2zen (int *p1, int *p2)
|
||||
{
|
||||
if ((*p2 >= 74 && *p2 <= 103) || (*p2 >= 110 && *p2 <= 122))
|
||||
(*p2)++;
|
||||
else if (*p2 == 131 && *p2 == 69)
|
||||
else if (*p2 == 131 || *p2 == 69)
|
||||
*p2 = 148;
|
||||
}
|
||||
else if (handaku && *p2 >= 110 && *p2 <= 122)
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ void gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out)
|
||||
if (gdImageGetPixel(image, x, y) == fg) {
|
||||
c |= b;
|
||||
}
|
||||
if ((b == 128) || (x == sx && y == sy)) {
|
||||
if ((b == 128) || (x == sx - 1)) {
|
||||
b = 1;
|
||||
if (p) {
|
||||
gdCtxPrintf(out, ", ");
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
--TEST--
|
||||
Bug #43475 (Thick styled lines have scrambled patterns)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/similarity.inc';
|
||||
|
||||
function setStyleAndThickness($im, $color, $thickness)
|
||||
{
|
||||
$style = array();
|
||||
$i = 0;
|
||||
while ($i < 16 * $thickness) {
|
||||
$style[$i++] = $color;
|
||||
}
|
||||
while ($i < 20 * $thickness) {
|
||||
$style[$i++] = IMG_COLOR_TRANSPARENT;
|
||||
}
|
||||
while ($i < 28 * $thickness) {
|
||||
$style[$i++] = $color;
|
||||
}
|
||||
while ($i < 32 * $thickness) {
|
||||
$style[$i++] = IMG_COLOR_TRANSPARENT;
|
||||
}
|
||||
imagesetstyle($im, $style);
|
||||
imagesetthickness($im, $thickness);
|
||||
}
|
||||
|
||||
$im = imagecreate(800, 800);
|
||||
imagecolorallocate($im, 255, 255, 255);
|
||||
$black = imagecolorallocate($im, 0, 0, 0);
|
||||
|
||||
setStyleAndThickness($im, $black, 1);
|
||||
imageline($im, 50, 250, 550, 250, IMG_COLOR_STYLED);
|
||||
imageline($im, 550, 250, 550, 750, IMG_COLOR_STYLED);
|
||||
imageline($im, 550, 750, 50, 250, IMG_COLOR_STYLED);
|
||||
|
||||
setStyleAndThickness($im, $black, 2);
|
||||
imageline($im, 100, 200, 600, 200, IMG_COLOR_STYLED);
|
||||
imageline($im, 600, 200, 600, 700, IMG_COLOR_STYLED);
|
||||
imageline($im, 600, 700, 100, 200, IMG_COLOR_STYLED);
|
||||
|
||||
setStyleAndThickness($im, $black, 4);
|
||||
imageline($im, 150, 150, 650, 150, IMG_COLOR_STYLED);
|
||||
imageline($im, 650, 150, 650, 650, IMG_COLOR_STYLED);
|
||||
imageline($im, 650, 650, 150, 150, IMG_COLOR_STYLED);
|
||||
|
||||
setStyleAndThickness($im, $black, 6);
|
||||
imageline($im, 200, 100, 700, 100, IMG_COLOR_STYLED);
|
||||
imageline($im, 700, 100, 700, 600, IMG_COLOR_STYLED);
|
||||
imageline($im, 700, 600, 200, 100, IMG_COLOR_STYLED);
|
||||
|
||||
$ex = imagecreatefrompng(__DIR__ . '/bug43475.png');
|
||||
var_dump(calc_image_dissimilarity($ex, $im) < 1e-5);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #43828 (broken transparency of imagearc for truecolor in blendingmode)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip ext/gd not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$im = imagecreatetruecolor(100,100);
|
||||
|
||||
$transparent = imagecolorallocatealpha($im, 255, 255, 255, 80);
|
||||
imagefilledrectangle($im, 0,0, 99,99, $transparent);
|
||||
$color = imagecolorallocatealpha($im, 0, 255, 0, 100);
|
||||
imagefilledarc($im, 49, 49, 99,99, 0 , 360, $color, IMG_ARC_PIE);
|
||||
|
||||
ob_start();
|
||||
imagepng($im);
|
||||
echo md5(ob_get_clean());
|
||||
imagedestroy($im);
|
||||
?>
|
||||
--EXPECT--
|
||||
3d82e4525f19790ae1055366e2a36917
|
||||
@@ -12,8 +12,6 @@ $white = imagecolorallocate($im, 255, 255, 255);
|
||||
imagefilledrectangle($im, 2, 2, 6, 6, $white);
|
||||
imagexbm($im, NULL);
|
||||
?>
|
||||
--XFAIL--
|
||||
Padding is not implemented yet
|
||||
--EXPECT--
|
||||
#define image_width 9
|
||||
#define image_height 9
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/similarity.inc';
|
||||
|
||||
$im = imagecreatetruecolor(640, 480);
|
||||
|
||||
$points = array(
|
||||
100, 100,
|
||||
100, 200,
|
||||
100, 300
|
||||
);
|
||||
imagefilledpolygon($im, $points, 3, 0xFFFF00);
|
||||
|
||||
$points = array(
|
||||
300, 200,
|
||||
400, 200,
|
||||
500, 200
|
||||
);
|
||||
imagefilledpolygon($im, $points, 3, 0xFFFF00);
|
||||
|
||||
$ex = imagecreatefrompng(__DIR__ . '/bug64641.png');
|
||||
if (($diss = calc_image_dissimilarity($ex, $im)) < 1e-5) {
|
||||
echo "IDENTICAL";
|
||||
} else {
|
||||
echo "DISSIMILARITY: $diss";
|
||||
}
|
||||
imagedestroy($ex);
|
||||
|
||||
imagedestroy($im);
|
||||
?>
|
||||
--EXPECT--
|
||||
IDENTICAL
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #72298: pass2_no_dither out-of-bounds access
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$img = imagecreatetruecolor (1 , 1);
|
||||
imagecolortransparent($img, 0);
|
||||
imagetruecolortopalette($img, false, 4);
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
|
||||
--SKIPIF--
|
||||
<?php if (!function_exists("imagecreatefromgd2")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fname = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug72339.gd";
|
||||
|
||||
$fh = fopen($fname, "w");
|
||||
fwrite($fh, "gd2\x00");
|
||||
fwrite($fh, pack("n", 2));
|
||||
fwrite($fh, pack("n", 1));
|
||||
fwrite($fh, pack("n", 1));
|
||||
fwrite($fh, pack("n", 0x40));
|
||||
fwrite($fh, pack("n", 2));
|
||||
fwrite($fh, pack("n", 0x5AA0)); // Chunks Wide
|
||||
fwrite($fh, pack("n", 0x5B00)); // Chunks Vertically
|
||||
fwrite($fh, str_repeat("\x41\x41\x41\x41", 0x1000000)); // overflow data
|
||||
fclose($fh);
|
||||
|
||||
$im = imagecreatefromgd2($fname);
|
||||
|
||||
if ($im) {
|
||||
imagedestroy($im);
|
||||
}
|
||||
unlink($fname);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: imagecreatefromgd2(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully
|
||||
in %sbug72339.php on line %d
|
||||
|
||||
Warning: imagecreatefromgd2(): '%sbug72339.gd' is not a valid GD2 file in %sbug72339.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd))
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$img = imagecreatetruecolor(100, 100);
|
||||
imagecolortransparent($img, -1000000);
|
||||
imagetruecolortopalette($img, TRUE, 3);
|
||||
imagecolortransparent($img, 9);
|
||||
echo "OK";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 0
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$img = imagecreatetruecolor(13, 1007);
|
||||
|
||||
imagecolortransparent($img, -10066304);
|
||||
imagetruecolortopalette($img, TRUE, 3);
|
||||
imagescale($img, 1, 65535);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die("skip gd extension not available\n");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$img = imagecreatetruecolor(100, 100);
|
||||
imagecolortransparent($img, -1000000);
|
||||
imagetruecolortopalette($img, TRUE, 3);
|
||||
imagecolortransparent($img, 9);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
==DONE==
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #72596 (imagetypes function won't advertise WEBP support)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(function_exists('imagewebp') === (bool) (imagetypes() & IMG_WEBP));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #72604 (imagearc() ignores thickness for full arcs)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip requires ext/gd');
|
||||
if (!(imagetypes() & IMG_PNG)) die('skip requires PNG support');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatetruecolor(100, 100);
|
||||
imagesetthickness($im, 5);
|
||||
imagearc($im, 50, 50, 90, 90, 0, 360, 0xffffff);
|
||||
ob_start();
|
||||
imagepng($im);
|
||||
$imagestring = ob_get_clean();
|
||||
echo md5($imagestring);
|
||||
?>
|
||||
--EXPECT--
|
||||
2ffa6afb915afbdf870cf6459477bc8a
|
||||
@@ -25,24 +25,26 @@ var_dump(gd_info());
|
||||
*** Testing gd_info() : variation ***
|
||||
array(%d) {
|
||||
["GD Version"]=>
|
||||
string(%d) %a
|
||||
string(%d) %s
|
||||
["FreeType Support"]=>
|
||||
bool%a
|
||||
bool(%a
|
||||
["GIF Read Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
["GIF Create Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
["JPEG Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
["PNG Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
["WBMP Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
["XPM Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
["XBM Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
["WebP Support"]=>
|
||||
bool(%s)
|
||||
["JIS-mapped Japanese Font Support"]=>
|
||||
bool%a
|
||||
bool(%s)
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Github #215 (imagefilltoborder stack overflow when invalid pallete index used)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("gd")) die("skip GD not present");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$image = imagecreate( 10, 10 );
|
||||
$bgd = imagecolorallocate( $image, 0, 0, 0 );
|
||||
$border = imagecolorallocate( $image, 255, 0, 0 );
|
||||
$fillcolor = imagecolorallocate( $image, 255, 0, 0 );
|
||||
|
||||
/* Use unallocated color index */
|
||||
imagefilltoborder( $image, 0,0, $border+10, $fillcolor);
|
||||
echo "#1 passes\n";
|
||||
|
||||
/* Use negative color index */
|
||||
imagefilltoborder( $image, 0,0, -$border, $fillcolor);
|
||||
echo "#2 passes\n";
|
||||
|
||||
|
||||
/* Use unallocated color index */
|
||||
imagefilltoborder( $image, 0,0, $border, $fillcolor+10);
|
||||
echo "#3 passes\n";
|
||||
|
||||
/* Use negative color index */
|
||||
imagefilltoborder( $image, 0,0, $border, -$fillcolor);
|
||||
echo "#4 passes\n";
|
||||
|
||||
|
||||
/* Use negative color index */
|
||||
imagefilltoborder( $image, 0,0, $border+10, $fillcolor+10);
|
||||
echo "#5 passes";
|
||||
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
#1 passes
|
||||
#2 passes
|
||||
#3 passes
|
||||
#4 passes
|
||||
#5 passes
|
||||
@@ -26,5 +26,5 @@ var_dump(md5(base64_encode($imgsrc)));
|
||||
var_dump($corA);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(32) "b856a0b1a15efe0f79551ebbb5651fe8"
|
||||
string(32) "f95489d97f4f1a5c4dc265388922d1ec"
|
||||
int(842163455)
|
||||
@@ -25,4 +25,4 @@ ob_end_clean();
|
||||
echo md5(base64_encode($img));
|
||||
?>
|
||||
--EXPECT--
|
||||
894f394c7f2e2364642ef27fea6bfc33
|
||||
beffeaf5231adaaff1f21a2108fb6f7e
|
||||
@@ -25,4 +25,4 @@ ob_end_clean();
|
||||
echo md5(base64_encode($img));
|
||||
?>
|
||||
--EXPECT--
|
||||
b77bbb8207e5adbebfcc8bd1c4074305
|
||||
b467492b806001c3720b3f18cfbde5b0
|
||||
@@ -25,4 +25,4 @@ ob_end_clean();
|
||||
echo md5(base64_encode($img));
|
||||
?>
|
||||
--EXPECT--
|
||||
b8b572812b3c85678f6c38c4ecca7619
|
||||
cfad369fc6d863785d3c95b4b4788225
|
||||
@@ -29,4 +29,4 @@ if ($gamma){
|
||||
echo md5(base64_encode($img));
|
||||
?>
|
||||
--EXPECT--
|
||||
30639772903913594bc665743e1b9ab8
|
||||
e79553115df689ea5df18a4636380569
|
||||
@@ -29,4 +29,4 @@ if ($gamma){
|
||||
echo md5(base64_encode($img));
|
||||
?>
|
||||
--EXPECT--
|
||||
7716c0905ae08bd84b4d6cba8969a42e
|
||||
b017b1ddc8bda00e82aa8cbfb54c35d4
|
||||
@@ -28,4 +28,4 @@ echo md5(base64_encode($img));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
0843f63ab2f9fddedd69b0b421686bc5
|
||||
1d41787ff70aa0c7eea5ee9304afa36b
|
||||
+6
-1
@@ -588,10 +588,15 @@ static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned ch
|
||||
zval *zv;
|
||||
int retval = FAILURE;
|
||||
php_unserialize_data_t unserialize_data = (php_unserialize_data_t) data;
|
||||
zval object_copy;
|
||||
|
||||
PHP_VAR_UNSERIALIZE_INIT(unserialize_data);
|
||||
gmp_create(object, &gmpnum);
|
||||
|
||||
/* The "object" variable may be modified during the execution of this unserialize handler
|
||||
* (it may turn into a reference). Keep the original object around for futher operations. */
|
||||
ZVAL_COPY_VALUE(&object_copy, object);
|
||||
|
||||
p = buf;
|
||||
max = buf + buf_len;
|
||||
|
||||
@@ -614,7 +619,7 @@ static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned ch
|
||||
|
||||
if (zend_hash_num_elements(Z_ARRVAL_P(zv)) != 0) {
|
||||
zend_hash_copy(
|
||||
zend_std_get_properties(object), Z_ARRVAL_P(zv),
|
||||
zend_std_get_properties(&object_copy), Z_ARRVAL_P(zv),
|
||||
(copy_ctor_func_t) zval_add_ref
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Unserialize GMP instance with internal reference to itself
|
||||
--FILE--
|
||||
<?php
|
||||
$s = 'C:3:"GMP":23:{s:1:"2";a:1:{i:46;R:1;}}';
|
||||
var_dump(unserialize($s));
|
||||
?>
|
||||
--EXPECT--
|
||||
object(GMP)#1 (2) {
|
||||
[46]=>
|
||||
*RECURSION*
|
||||
["num"]=>
|
||||
string(1) "2"
|
||||
}
|
||||
@@ -261,7 +261,7 @@ static zend_object *Calendar_object_create(zend_class_entry *ce)
|
||||
intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1));
|
||||
|
||||
zend_object_std_init(&intern->zo, ce);
|
||||
object_properties_init((zend_object*) intern, ce);
|
||||
object_properties_init(&intern->zo, ce);
|
||||
calendar_object_init(intern);
|
||||
|
||||
|
||||
|
||||
+1
-4
@@ -158,15 +158,12 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
|
||||
len = uidna_nameToUnicodeUTF8(uts46, domain, domain_len,
|
||||
ZSTR_VAL(buffer), buffer_capac, &info, &status);
|
||||
}
|
||||
if (php_intl_idn_check_status(status, "failed to convert name",
|
||||
if (len >= 255 || php_intl_idn_check_status(status, "failed to convert name",
|
||||
mode) == FAILURE) {
|
||||
uidna_close(uts46);
|
||||
zend_string_free(buffer);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (len >= 255) {
|
||||
php_error_docref(NULL, E_ERROR, "ICU returned an unexpected length");
|
||||
}
|
||||
|
||||
ZSTR_VAL(buffer)[len] = '\0';
|
||||
ZSTR_LEN(buffer) = len;
|
||||
|
||||
@@ -1598,6 +1598,24 @@ PHP_FUNCTION(locale_accept_from_http)
|
||||
"locale_accept_from_http: unable to parse input parameters", 0 );
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if(http_accept_len > ULOC_FULLNAME_CAPACITY) {
|
||||
/* check each fragment, if any bigger than capacity, can't do it due to bug #72533 */
|
||||
char *start = http_accept;
|
||||
char *end;
|
||||
size_t len;
|
||||
do {
|
||||
end = strchr(start, ',');
|
||||
len = end ? end-start : http_accept_len-(start-http_accept);
|
||||
if(len > ULOC_FULLNAME_CAPACITY) {
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"locale_accept_from_http: locale string too long", 0 TSRMLS_CC );
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if(end) {
|
||||
start = end+1;
|
||||
}
|
||||
} while(end != NULL);
|
||||
}
|
||||
|
||||
available = ures_openAvailableLocales(NULL, &status);
|
||||
INTL_CHECK_STATUS(status, "locale_accept_from_http: failed to retrieve locale list");
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
#include "../intl_common.h"
|
||||
#include "../intl_error.h"
|
||||
#include "../intl_data.h"
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
|
||||
# define MSG_FORMAT_QUOTE_APOS 1
|
||||
#endif
|
||||
|
||||
#include "msgformat_data.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -54,8 +59,4 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
|
||||
|
||||
#define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf
|
||||
|
||||
#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
|
||||
# define MSG_FORMAT_QUOTE_APOS 1
|
||||
#endif
|
||||
|
||||
#endif // #ifndef MSG_FORMAT_CLASS_H
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #72506 (idn_to_ascii with INTL_IDNA_VARIANT_UTS46 fatals for long domain names)
|
||||
--DESCRIPTION--
|
||||
Actually, the $info array should be populated for these cases, but at least it's
|
||||
not clear yet with which values exactly.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip this test requires ext/intl');
|
||||
if (!defined('INTL_IDNA_VARIANT_UTS46')) die('skip no UTS #46 API');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
// ASCII domain name with 255 characters
|
||||
$domain = str_repeat('a.', 126) . 'aaa';
|
||||
$result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
|
||||
var_dump($result, $info);
|
||||
|
||||
// ASCII domain name with 256 characters – one character added
|
||||
$domain .= 'a';
|
||||
$result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
|
||||
var_dump($result, $info);
|
||||
|
||||
// International domain name with cyrillic "ф" characters
|
||||
$domain = str_repeat('ф.', 32) . 'a';
|
||||
$result = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46, $info);
|
||||
var_dump($result, $info);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
array(0) {
|
||||
}
|
||||
bool(false)
|
||||
array(0) {
|
||||
}
|
||||
bool(false)
|
||||
array(0) {
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #72533 (locale_accept_from_http out-of-bounds access)
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$ret = var_export(ut_loc_accept_http(str_repeat('x', 256)), true);
|
||||
$ret .= "\n";
|
||||
if(intl_is_failure(intl_get_error_code())) {
|
||||
$ret .= var_export(intl_get_error_message(), true);
|
||||
}
|
||||
$ret .= "\n";
|
||||
$ret .= var_export(ut_loc_accept_http(str_repeat('en,', 256)), true);
|
||||
$ret .= "\n";
|
||||
if(intl_is_failure(intl_get_error_code())) {
|
||||
$ret .= var_export(intl_get_error_message(), true);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECTF--
|
||||
false
|
||||
'locale_accept_from_http: locale string too long: U_ILLEGAL_ARGUMENT_ERROR'
|
||||
'en'
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property)
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class A extends IntlCalendar {
|
||||
public function __construct() {}
|
||||
private $a;
|
||||
}
|
||||
var_dump(new A());
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(A)#%d (1) {
|
||||
["valid"]=>
|
||||
bool(false)
|
||||
}
|
||||
@@ -23,7 +23,7 @@ echo "\n";
|
||||
$timeMillis = $cal->getTime();
|
||||
$time = time();
|
||||
|
||||
var_dump(abs($timeMillis - $time * 1000) < 1000);
|
||||
var_dump(abs($timeMillis - $time * 1000) < 2000);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
|
||||
@@ -13,11 +13,11 @@ $now = IntlCalendar::getNow();
|
||||
$proc_now = intlcal_get_now();
|
||||
$time = time();
|
||||
var_dump(abs($now - $proc_now) < 500);
|
||||
var_dump(abs($time * 1000 - $proc_now) < 1000);
|
||||
var_dump(abs($time * 1000 - $proc_now) < 2000);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
==DONE==
|
||||
==DONE==
|
||||
+1
-1
@@ -1278,8 +1278,8 @@ PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object)
|
||||
efree(object->document->doc_props);
|
||||
}
|
||||
efree(object->document);
|
||||
object->document = NULL;
|
||||
}
|
||||
object->document = NULL;
|
||||
}
|
||||
|
||||
return ret_refcount;
|
||||
|
||||
@@ -454,13 +454,17 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
|
||||
rc = zend_hash_str_find_ptr(&MBREX(ht_rc), (char *)pattern, patlen);
|
||||
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
|
||||
if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
|
||||
onig_error_code_to_str(err_str, err_code, err_info);
|
||||
onig_error_code_to_str(err_str, err_code, &err_info);
|
||||
php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
|
||||
retval = NULL;
|
||||
goto out;
|
||||
}
|
||||
if (rc == MBREX(search_re)) {
|
||||
/* reuse the new rc? see bug #72399 */
|
||||
MBREX(search_re) = NULL;
|
||||
}
|
||||
zend_hash_str_update_ptr(&MBREX(ht_rc), (char *)pattern, patlen, retval);
|
||||
} else if (rc) {
|
||||
} else {
|
||||
retval = rc;
|
||||
}
|
||||
out:
|
||||
@@ -807,7 +811,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
|
||||
OnigUChar *pos;
|
||||
OnigUChar *string_lim;
|
||||
char *description = NULL;
|
||||
char pat_buf[4];
|
||||
char pat_buf[6];
|
||||
|
||||
const mbfl_encoding *enc;
|
||||
|
||||
@@ -860,6 +864,8 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
|
||||
pat_buf[1] = '\0';
|
||||
pat_buf[2] = '\0';
|
||||
pat_buf[3] = '\0';
|
||||
pat_buf[4] = '\0';
|
||||
pat_buf[5] = '\0';
|
||||
|
||||
arg_pattern = pat_buf;
|
||||
arg_pattern_len = 1;
|
||||
@@ -982,7 +988,6 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
|
||||
smart_str_free(&eval_buf);
|
||||
zval_ptr_dtor(&retval);
|
||||
} else {
|
||||
efree(description);
|
||||
if (!EG(exception)) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to call custom replacement function");
|
||||
}
|
||||
@@ -1241,9 +1246,6 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
php_error_docref(NULL, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
|
||||
RETVAL_FALSE;
|
||||
} else {
|
||||
if (MBREX(search_regs)->beg[0] == MBREX(search_regs)->end[0]) {
|
||||
php_error_docref(NULL, E_WARNING, "Empty regular expression");
|
||||
}
|
||||
switch (mode) {
|
||||
case 1:
|
||||
array_init(return_value);
|
||||
@@ -1270,7 +1272,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
break;
|
||||
}
|
||||
end = MBREX(search_regs)->end[0];
|
||||
if (pos < end) {
|
||||
if (pos <= end) {
|
||||
MBREX(search_pos) = end;
|
||||
} else {
|
||||
MBREX(search_pos) = pos + 1;
|
||||
@@ -1406,7 +1408,7 @@ PHP_FUNCTION(mb_ereg_search_setpos)
|
||||
return;
|
||||
}
|
||||
|
||||
if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) {
|
||||
if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position > Z_STRLEN(MBREX(search_str)))) {
|
||||
php_error_docref(NULL, E_WARNING, "Position is out of range");
|
||||
MBREX(search_pos) = 0;
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #72399 (Use-After-Free in MBString (search_re))
|
||||
--FILE--
|
||||
<?php
|
||||
$var5 = mbereg_search_init("","2");
|
||||
$var6 = mb_eregi_replace("2","","");
|
||||
$var13 = mbereg_search_pos();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: mbereg_search_pos(): No regex given in %sbug72399.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #72402: _php_mb_regex_ereg_replace_exec - double free
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function throwit() {
|
||||
throw new Exception('it');
|
||||
}
|
||||
$var10 = "throwit";
|
||||
try {
|
||||
$var14 = mb_ereg_replace_callback("", $var10, "");
|
||||
} catch(Exception $e) {}
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #72691 (mb_ereg_search raises a warning if a match zero-width)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip ext/mbstring required');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$str = 'foo';
|
||||
mb_ereg_search_init($str);
|
||||
|
||||
mb_ereg_search('\A');
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
var_dump(mb_ereg_search_getregs());
|
||||
|
||||
mb_ereg_search('\s*');
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
var_dump(mb_ereg_search_getregs());
|
||||
|
||||
mb_ereg_search('\w+');
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
var_dump(mb_ereg_search_getregs());
|
||||
|
||||
mb_ereg_search('\Z');
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
var_dump(mb_ereg_search_getregs());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(0) ""
|
||||
}
|
||||
int(0)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(0) ""
|
||||
}
|
||||
int(3)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "foo"
|
||||
}
|
||||
int(3)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(0) ""
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
--TEST--
|
||||
Bug #72693 (mb_ereg_search increments search position when a match zero-width)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip ext/mbstring required');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
mb_ereg_search_init('foo');
|
||||
|
||||
var_dump(mb_ereg_search('\A'));
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
|
||||
var_dump(mb_ereg_search('\s*'));
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
|
||||
var_dump(mb_ereg_search('\w+'));
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
var_dump(mb_ereg_search_getregs());
|
||||
|
||||
var_dump(mb_ereg_search('\s*'));
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
|
||||
var_dump(mb_ereg_search('\Z'));
|
||||
var_dump(mb_ereg_search_getpos());
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
int(0)
|
||||
bool(true)
|
||||
int(0)
|
||||
bool(true)
|
||||
int(3)
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "foo"
|
||||
}
|
||||
bool(true)
|
||||
int(3)
|
||||
bool(true)
|
||||
int(3)
|
||||
Loaded 100 of 229 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user