From: Serhiy Storchaka Date: Fri, 24 Jul 2015 09:58:25 +0000 (+0300) Subject: Issue #24704: Fixed possible NULL pointer dereferencing in the _json module X-Git-Tag: v2.7.11rc1~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=045c451ff4151ec4ecfd91a3f2888f0214dadc92;p=thirdparty%2FPython%2Fcpython.git Issue #24704: Fixed possible NULL pointer dereferencing in the _json module initialization. Patch by Pankaj Sharma. --- diff --git a/Modules/_json.c b/Modules/_json.c index 3349b0cded72..121126d5ed78 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -2419,6 +2419,8 @@ init_json(void) if (PyType_Ready(&PyEncoderType) < 0) return; m = Py_InitModule3("_json", speedups_methods, module_doc); + if (m == NULL) + return; Py_INCREF((PyObject*)&PyScannerType); PyModule_AddObject(m, "make_scanner", (PyObject*)&PyScannerType); Py_INCREF((PyObject*)&PyEncoderType);