mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +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
2 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key);
|
||||||
if (t != key) {
|
if (t != key) {
|
||||||
// o is registered in c_const_cache. Just use it.
|
// o is registered in c_const_cache. Just use it.
|
||||||
Py_INCREF(t);
|
Py_XINCREF(t);
|
||||||
Py_DECREF(key);
|
Py_DECREF(key);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue