]> granicus.if.org Git - python/commitdiff
Issue #24704: Fixed possible NULL pointer dereferencing in the _json module
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 24 Jul 2015 09:58:25 +0000 (12:58 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 24 Jul 2015 09:58:25 +0000 (12:58 +0300)
initialization.  Patch by Pankaj Sharma.

Modules/_json.c

index 3349b0cded722d5cc992df0ea4b30d98134c2d45..121126d5ed7823b83f35852f9b9ac9a5a6745718 100644 (file)
@@ -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);