Skip to content

Commit e858ea1

Browse files
committed
Assert that address is in bounds (ASAN thinks it might not be).
1 parent f9e999c commit e858ea1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/ceval.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,6 +3517,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
35173517
DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR);
35183518
PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict;
35193519
DEOPT_IF(dict->ma_keys->dk_version != cache1->dk_version_or_hint, LOAD_ATTR);
3520+
assert(cache0->index < dict->ma_keys->dk_nentries);
35203521
PyDictKeyEntry *ep = DK_ENTRIES(dict->ma_keys) + cache0->index;
35213522
res = ep->me_value;
35223523
DEOPT_IF(res == NULL, LOAD_ATTR);

0 commit comments

Comments
 (0)