mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
[ 1497053 ] Let dicts propagate the exceptions in user __eq__().
[ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
This commit is contained in:
parent
e08940ef6c
commit
35f6d36951
6 changed files with 183 additions and 101 deletions
|
@ -1855,15 +1855,26 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
|||
long hash = ((PyStringObject *)w)->ob_shash;
|
||||
if (hash != -1) {
|
||||
PyDictObject *d;
|
||||
PyDictEntry *e;
|
||||
d = (PyDictObject *)(f->f_globals);
|
||||
x = d->ma_lookup(d, w, hash)->me_value;
|
||||
e = d->ma_lookup(d, w, hash);
|
||||
if (e == NULL) {
|
||||
x = NULL;
|
||||
break;
|
||||
}
|
||||
x = e->me_value;
|
||||
if (x != NULL) {
|
||||
Py_INCREF(x);
|
||||
PUSH(x);
|
||||
continue;
|
||||
}
|
||||
d = (PyDictObject *)(f->f_builtins);
|
||||
x = d->ma_lookup(d, w, hash)->me_value;
|
||||
e = d->ma_lookup(d, w, hash);
|
||||
if (e == NULL) {
|
||||
x = NULL;
|
||||
break;
|
||||
}
|
||||
x = e->me_value;
|
||||
if (x != NULL) {
|
||||
Py_INCREF(x);
|
||||
PUSH(x);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue