Python interface to Part can be used to crash the application #13208
Labels
Coding: Python
Coding issue related to Python
Crash
For issues describing crashes or PRs fixing one
WB Part
Related to the Part Workbench
Is there an existing issue for this?
Problem description
The issue here is that it is possible to create initialized Python Objects with no OCCT shapes defined inside them (null), and then to call OCCT with that null shape pointer leading to the crash. The solutions could be: add defense c++ code inside the add() methods that checks to see if there is a shape and raises an exception, or to put dummy shapes in the Python Objects ( probably bad side effects ), or to block the use of the empty constructor ( tricky, might break existing code or addons ).
Also, there may be other methods that make the invalid assumption that there is a shape, and other Part object types like Wire and BuildPlateSurface. This needs a full survey to locate the affected code, at which point the changes should be straightorward.
Full version info
Subproject(s) affected?
Part
Anything else?
Wish I wasn't busy with Toponaming to hunt this down. It is a good, easy intro to coding the C++ to Python interface.
Code of Conduct
The text was updated successfully, but these errors were encountered: