Repository navigation
Commit f4cb9a8
committed
fix(runtime): guard null operator overload and named data key dereferences
Guard against null pointer dereferences when logging KernelCall errors
in Method::execute_instruction and when resolving keys in FlatTensorDataMap.
- runtime/executor/method.cpp: Check op and op->overload() before invoking
c_str() in the KernelCall failure log. Operators with no overload string
now format cleanly as op_name without segfaulting.
- extension/flat_tensor/flat_tensor_data_map.cpp: In get_named_data, verify
entry and entry->key() are non-null before comparison. In get_key, validate
index bounds and check entry and entry->key() are non-null before returning,
returning InvalidExternalData on malformed entries instead of faulting.
- extension/flat_tensor/test/flat_tensor_data_map_test.cpp: Add test coverage
for out-of-bounds key access.
Fixes #23955.1 parent 0015c76 commit f4cb9a8
3 files changed
Lines changed: 41 additions & 9 deletions
File tree
- extension/flat_tensor
- test
- runtime/executor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | | - | |
| 72 | + | |
69 | 73 | | |
70 | | - | |
71 | | - | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
249 | 253 | | |
250 | 254 | | |
251 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
252 | 259 | | |
253 | 260 | | |
254 | 261 | | |
255 | 262 | | |
256 | 263 | | |
257 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
258 | 269 | | |
259 | 270 | | |
260 | 271 | | |
261 | 272 | | |
262 | 273 | | |
263 | 274 | | |
264 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
265 | 287 | | |
266 | 288 | | |
267 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
1735 | 1741 | | |
1736 | 1742 | | |
1737 | 1743 | | |
1738 | | - | |
| 1744 | + | |
1739 | 1745 | | |
1740 | 1746 | | |
1741 | | - | |
1742 | | - | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
1743 | 1750 | | |
1744 | 1751 | | |
1745 | 1752 | | |
| |||
0 commit comments