Commit f205184
committed
Fix Coverity OVERRUN false positive in _allocate_result
Declare f_ndim as a C int so that f_ndim * sizeof(npy_intp) is computed
as a plain C multiplication instead of being routed through a Python
object. The untyped variable caused Cython to generate a
__Pyx_PyLong_As_size_t conversion whose (size_t)-1 error sentinel led
Coverity to report an out-of-bounds access (OVERRUN, CID 652776/652762)
on the PyMem_Malloc/memcpy of f_shape. This mirrors b_ndim in
_pad_array, which is already typed and was never flagged.1 parent 25ceb1e commit f205184
2 files changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| |||
0 commit comments