]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36374: Fix a possible null pointer dereference (GH-12449)
authorZackery Spytz <zspytz@gmail.com>
Wed, 20 Mar 2019 09:16:25 +0000 (03:16 -0600)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 20 Mar 2019 09:16:25 +0000 (02:16 -0700)
https://bugs.python.org/issue36374

Misc/NEWS.d/next/Core and Builtins/2019-03-19-15-46-42.bpo-36374.EWKMZE.rst [new file with mode: 0644]
Python/compile.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-03-19-15-46-42.bpo-36374.EWKMZE.rst b/Misc/NEWS.d/next/Core and Builtins/2019-03-19-15-46-42.bpo-36374.EWKMZE.rst
new file mode 100644 (file)
index 0000000..2eac301
--- /dev/null
@@ -0,0 +1,2 @@
+Fix a possible null pointer dereference in ``merge_consts_recursive()``.
+Patch by Zackery Spytz.
index 697833752bb0bdaa6371d12dd0b05ea0b781c5a2..3656a7e00efd939ce027b54572a5efdad2f34dc3 100644 (file)
@@ -1210,7 +1210,7 @@ merge_consts_recursive(struct compiler *c, PyObject *o)
     PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key);
     if (t != key) {
         // o is registered in c_const_cache.  Just use it.
-        Py_INCREF(t);
+        Py_XINCREF(t);
         Py_DECREF(key);
         return t;
     }