-
Notifications
You must be signed in to change notification settings - Fork 4
Add Bounds Check #1
Copy link
Copy link
Open
Description
Considering the context is python there should be bounds checks where appropriate to avoid undefined behavior in the CavalierContours library.
I think there is only one place that is missing the check when calling cavc_remove_range: https://github.com/proto3/cavaliercontours-python/blob/master/cavaliercontours/cavaliercontours.py#L174
if start_index < 0 or count < 0 or start_index + count > self.vertex_count():
...throw index out of range here...I added checks that start_index and count are positive since I wasn't sure how it coerces to a uint32 if a negative value is given (it may wrap to a very large uint32, on the python docs it says no overflow checking is done for a c_uint: https://docs.python.org/3/library/ctypes.html).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels