Kaydet (Commit) 045c451f authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #24704: Fixed possible NULL pointer dereferencing in the _json module

initialization.  Patch by Pankaj Sharma.
üst 3b77d01d
...@@ -2419,6 +2419,8 @@ init_json(void) ...@@ -2419,6 +2419,8 @@ init_json(void)
if (PyType_Ready(&PyEncoderType) < 0) if (PyType_Ready(&PyEncoderType) < 0)
return; return;
m = Py_InitModule3("_json", speedups_methods, module_doc); m = Py_InitModule3("_json", speedups_methods, module_doc);
if (m == NULL)
return;
Py_INCREF((PyObject*)&PyScannerType); Py_INCREF((PyObject*)&PyScannerType);
PyModule_AddObject(m, "make_scanner", (PyObject*)&PyScannerType); PyModule_AddObject(m, "make_scanner", (PyObject*)&PyScannerType);
Py_INCREF((PyObject*)&PyEncoderType); Py_INCREF((PyObject*)&PyEncoderType);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment