Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2015-04-20 08:53:06 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2015-04-20 08:53:54 +0300
commitbf6bde232d42c3e1a41a3841292150fae3d214cc (patch)
treeddcb989eae9e6fa1afcae3428c2dc0689b8a8966 /source/gameengine
parentdbb2b29beab46a81c1ea95521a2afe39145717c5 (diff)
Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Expressions/KX_PythonCallBack.cpp5
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;