No bounds checking on fill/trace buf access
See original GitHub issueI’m having some trouble processing big 3d volumes using the library. The cause seems to be a lack of bounds checking on buf access in fill() and trace(), buf being statically sized. Due to the numba.jit usage it manifests as a segfault due to the out-of-bounds write.
Here’s a PR to add that bounds checking, and allows caller specification of the fixed buffer size to build_sknw():
https://github.com/yxdragon/sknw/pull/2
I guess it could also be dynamically resized, but I’m not familiar with numba.jit flavoured python so I’ll leave that.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Issues · Image-Py/sknw - GitHub
Empty Graph returned for circular skeletons without branches. #11 opened on Oct 16, 2020 by Quasimondo ... No bounds checking on fill/trace buf...
Read more >Accessing array out of bounds in C/C++ - GeeksforGeeks
Stay inside the bounds of the array in C programming while using arrays to avoid any such errors. C++ however offers the std::vector...
Read more >[PATCH V3 11/14] coresight: sink: Add TRBE driver - Mathieu ...
But the > access to the trace buffer could be prohibited by a higher exception level > (EL3 or EL2), indicated by TRBIDR_EL1....
Read more >No out of bounds error - Stack Overflow
When you access an array index, C and C++ don't do bound checking. ... code execution (the famous "buffer overflow" security breaches).
Read more >Application for Disruption of Solid Waste Disposal Area 10/12/15
No waste is anticipated to be encountered or removed ... Construction of on-landfill access road. ... has long range and fills up to....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I found that in build_sknw(ske, multi=False, iso=True, ring=True) if ske is of type np.uint8, then if node num > 255 - 10, node_num will be 0, that is a bug
so if node num > 255, we shoud make sure ske is of type np.int64
131042 * 8(int64) = 1M 131042 *1024 * 8 = 1G