Commit 26bf93a
committed
fix: Protect mem consumption from null deref
- add debug assertions to wasm_get_module_inst_mem_consumption
- add debug assertions to aot_get_module_inst_mem_consumption
- nullify memories pointer after free in destruction path
- nullify memories pointer after free in AOT destruction
- docs: add precondition documentation for memory consumption functions1 parent f0aa4e8 commit 26bf93a
3 files changed
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
966 | 966 | | |
967 | 967 | | |
968 | 968 | | |
| 969 | + | |
969 | 970 | | |
970 | 971 | | |
971 | 972 | | |
| |||
3795 | 3796 | | |
3796 | 3797 | | |
3797 | 3798 | | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
| 3808 | + | |
| 3809 | + | |
| 3810 | + | |
| 3811 | + | |
| 3812 | + | |
3798 | 3813 | | |
3799 | 3814 | | |
3800 | 3815 | | |
3801 | 3816 | | |
3802 | 3817 | | |
3803 | 3818 | | |
3804 | 3819 | | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
3805 | 3825 | | |
3806 | 3826 | | |
3807 | 3827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3445 | 3445 | | |
3446 | 3446 | | |
3447 | 3447 | | |
3448 | | - | |
| 3448 | + | |
3449 | 3449 | | |
3450 | 3450 | | |
| 3451 | + | |
| 3452 | + | |
3451 | 3453 | | |
3452 | 3454 | | |
3453 | 3455 | | |
| |||
4227 | 4229 | | |
4228 | 4230 | | |
4229 | 4231 | | |
| 4232 | + | |
| 4233 | + | |
| 4234 | + | |
| 4235 | + | |
| 4236 | + | |
| 4237 | + | |
| 4238 | + | |
| 4239 | + | |
| 4240 | + | |
| 4241 | + | |
| 4242 | + | |
| 4243 | + | |
| 4244 | + | |
| 4245 | + | |
4230 | 4246 | | |
4231 | 4247 | | |
4232 | 4248 | | |
4233 | 4249 | | |
4234 | 4250 | | |
4235 | 4251 | | |
4236 | 4252 | | |
| 4253 | + | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
| 4257 | + | |
4237 | 4258 | | |
4238 | 4259 | | |
4239 | 4260 | | |
| |||
0 commit comments