From 045c451ff4151ec4ecfd91a3f2888f0214dadc92 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 24 Jul 2015 12:58:25 +0300 Subject: Issue #24704: Fixed possible NULL pointer dereferencing in the _json module initialization. Patch by Pankaj Sharma. --- Modules/_json.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/_json.c b/Modules/_json.c index 3349b0c..121126d 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); -- cgit v0.12