diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2015-04-20 08:53:06 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2015-04-20 08:53:54 +0300 |
commit | bf6bde232d42c3e1a41a3841292150fae3d214cc (patch) | |
tree | ddcb989eae9e6fa1afcae3428c2dc0689b8a8966 | |
parent | dbb2b29beab46a81c1ea95521a2afe39145717c5 (diff) |
Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount
-rw-r--r-- | source/gameengine/Expressions/KX_PythonCallBack.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/gameengine/Expressions/KX_PythonCallBack.cpp b/source/gameengine/Expressions/KX_PythonCallBack.cpp index 946a385f306..1d97a8c7384 100644 --- a/source/gameengine/Expressions/KX_PythonCallBack.cpp +++ b/source/gameengine/Expressions/KX_PythonCallBack.cpp @@ -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; |