From: Christian Heimes Date: Fri, 26 Jul 2013 12:45:37 +0000 (+0200) Subject: Fix possible NULL pointer dereference in PyCurses_Start_Color() X-Git-Tag: v3.4.0a1~80^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a956e645c10051cada87abc90248b112df7e1974;p=thirdparty%2FPython%2Fcpython.git Fix possible NULL pointer dereference in PyCurses_Start_Color() CID 1058276 --- diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 132670d54808..f5df80c74648 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -2930,9 +2930,13 @@ PyCurses_Start_Color(PyObject *self) if (code != ERR) { initialisedcolors = TRUE; c = PyLong_FromLong((long) COLORS); + if (c == NULL) + return NULL; PyDict_SetItemString(ModDict, "COLORS", c); Py_DECREF(c); cp = PyLong_FromLong((long) COLOR_PAIRS); + if (cp == NULL) + return NULL; PyDict_SetItemString(ModDict, "COLOR_PAIRS", cp); Py_DECREF(cp); Py_INCREF(Py_None);