[Python-checkins] cpython (2.7): Issue #24704: Fixed possible NULL pointer dereferencing in the _json module

serhiy.storchaka python-checkins at python.org
Fri Jul 24 11:58:56 CEST 2015


https://hg.python.org/cpython/rev/a1a1e3fe837a
changeset:   97041:a1a1e3fe837a
branch:      2.7
parent:      97038:84070c1225c5
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jul 24 12:58:25 2015 +0300
summary:
  Issue #24704: Fixed possible NULL pointer dereferencing in the _json module
initialization.  Patch by Pankaj Sharma.

files:
  Modules/_json.c |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Modules/_json.c b/Modules/_json.c
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -2419,6 +2419,8 @@
     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);

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list