summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-07-24 09:58:25 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-07-24 09:58:25 (GMT)
commit045c451ff4151ec4ecfd91a3f2888f0214dadc92 (patch)
treeec5c1f3d73d0eb4483de9c093a1ccf838f85acf8
parent3b77d01dbc9e7cf8e32803a307f2ecf7b2bf0f05 (diff)
downloadcpython-045c451ff4151ec4ecfd91a3f2888f0214dadc92.zip
cpython-045c451ff4151ec4ecfd91a3f2888f0214dadc92.tar.gz
cpython-045c451ff4151ec4ecfd91a3f2888f0214dadc92.tar.bz2
Issue #24704: Fixed possible NULL pointer dereferencing in the _json module
initialization. Patch by Pankaj Sharma.
-rw-r--r--Modules/_json.c2
1 files changed, 2 insertions, 0 deletions
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);