Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount

This commit is contained in:
Sybren A. Stüvel 2015-04-20 13:53:06 +08:00
parent dbb2b29bea
commit bf6bde232d
Notes: blender-bot 2023-02-14 09:12:05 +01:00
Referenced by issue #44507, Compilation issue VS2013
1 changed files with 2 additions and 3 deletions

View File

@ -84,9 +84,8 @@ static PyObject *CreatePythonTuple(unsigned int argcount, PyObject **arglist)
void RunPythonCallBackList(PyObject *functionlist, PyObject **arglist, unsigned int minargcount, unsigned int maxargcount)
{
unsigned int size = PyList_Size(functionlist);
PyObject *argTuples[(maxargcount - minargcount) + 1];
argTuples[0] = NULL;
PyObject *argTuples[maxargcount - minargcount + 1];
memset(argTuples, 0, sizeof(PyObject *) * (maxargcount - minargcount + 1));
for (unsigned int i = 0; i < size; ++i) {
unsigned int funcargcount = 0;