Skip to content

Commit ddf47a6

Browse files
authored
C TypeTreeHelper - Safeguard against bogus Array definition (#300)
* C TypeTreeHelper - Safeguard against bogus Array definition
1 parent a40e04f commit ddf47a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

UnityPyBoost/TypeTreeHelper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,12 @@ PyObject *read_typetree_value(ReaderT *reader, TypeTreeNodeObject *node, TypeTre
834834
if (child && child->_data_type == NodeDataType::Array)
835835
{
836836
// array
837+
if (PyList_GET_SIZE(child->m_Children) != 2)
838+
{
839+
PyErr_SetString(PyExc_ValueError, "Array node must have 2 children");
840+
return NULL;
841+
}
842+
837843
if (child->_align)
838844
{
839845
align = true;

0 commit comments

Comments
 (0)