Repository navigation
Commit 605ac68
committed
Fix GH-22878: Use-after-free of callable via autoloader
Validating an array or string callable runs user code before its borrowed
method name is used: resolving a string class name can trigger an
autoloader, and a compound "Class::method" name emits an E_DEPRECATED that
reaches a user error handler. Either can free the callable, leaving the
borrowed method string dangling when the method is resolved. Hold that
string across the reentrant lookup in zend_is_callable_at_frame(),
zend_is_method_callable() and zend_init_dynamic_call_array().
Fixes GH-228781 parent fbdf959 commit 605ac68
4 files changed
Lines changed: 62 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3859 | 3859 | | |
3860 | 3860 | | |
3861 | 3861 | | |
| 3862 | + | |
3862 | 3863 | | |
3863 | 3864 | | |
3864 | 3865 | | |
| |||
3879 | 3880 | | |
3880 | 3881 | | |
3881 | 3882 | | |
| 3883 | + | |
3882 | 3884 | | |
3883 | 3885 | | |
3884 | 3886 | | |
3885 | 3887 | | |
3886 | 3888 | | |
3887 | 3889 | | |
3888 | 3890 | | |
| 3891 | + | |
3889 | 3892 | | |
3890 | 3893 | | |
3891 | 3894 | | |
| |||
3894 | 3897 | | |
3895 | 3898 | | |
3896 | 3899 | | |
| 3900 | + | |
3897 | 3901 | | |
3898 | 3902 | | |
3899 | 3903 | | |
| |||
4216 | 4220 | | |
4217 | 4221 | | |
4218 | 4222 | | |
| 4223 | + | |
| 4224 | + | |
4219 | 4225 | | |
4220 | 4226 | | |
4221 | 4227 | | |
4222 | 4228 | | |
4223 | 4229 | | |
| 4230 | + | |
| 4231 | + | |
4224 | 4232 | | |
| 4233 | + | |
4225 | 4234 | | |
4226 | 4235 | | |
4227 | 4236 | | |
| |||
4233 | 4242 | | |
4234 | 4243 | | |
4235 | 4244 | | |
| 4245 | + | |
| 4246 | + | |
4236 | 4247 | | |
4237 | 4248 | | |
4238 | | - | |
| 4249 | + | |
| 4250 | + | |
4239 | 4251 | | |
4240 | 4252 | | |
4241 | 4253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5259 | 5259 | | |
5260 | 5260 | | |
5261 | 5261 | | |
| 5262 | + | |
5262 | 5263 | | |
5263 | 5264 | | |
5264 | 5265 | | |
| 5266 | + | |
5265 | 5267 | | |
5266 | 5268 | | |
5267 | 5269 | | |
5268 | 5270 | | |
5269 | | - | |
| 5271 | + | |
5270 | 5272 | | |
5271 | | - | |
| 5273 | + | |
5272 | 5274 | | |
5273 | 5275 | | |
5274 | 5276 | | |
5275 | | - | |
| 5277 | + | |
5276 | 5278 | | |
| 5279 | + | |
5277 | 5280 | | |
5278 | 5281 | | |
| 5282 | + | |
5279 | 5283 | | |
5280 | 5284 | | |
5281 | 5285 | | |
| |||
0 commit comments