mirror of
https://github.com/python/cpython
synced 2024-09-04 15:56:13 +00:00
bpo-36374: Fix a possible null pointer dereference (GH-12449)
https://bugs.python.org/issue36374
This commit is contained in:
parent
fa15376848
commit
9b4a1b1e23
|
@ -0,0 +1,2 @@
|
|||
Fix a possible null pointer dereference in ``merge_consts_recursive()``.
|
||||
Patch by Zackery Spytz.
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue