Commit 75530a3
Github Executorch
Update on "Use safe_numel() in et"
The wasm bindings' assert_valid_numel() helper previously computed numel without overflow detection, letting a malicious tensor shape wrap to a small value that bypassed the data-size check. Replace with safe_numel() (returns Result<ssize_t>) and propagate the error via THROW_IF_ERROR as a JavaScript exception, matching the rest of the wasm error plumbing.
Authored with Claude.
Differential Revision: [D102082911](https://our.internmc.facebook.com/intern/diff/D102082911/)
[ghstack-poisoned]2 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
0 commit comments