diff options
author | Sam Gross <colesbury@gmail.com> | 2024-02-20 20:18:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 20:18:44 (GMT) |
commit | 520403ed4cdf4890d63403c9cf01ac63233f5ef4 (patch) | |
tree | 5a51e71547cbe711d8e067cdc65bb3fa1631e626 /Python/executor_cases.c.h | |
parent | 494739e1f71f8e290a2c869d4f40f4ea36a045c2 (diff) | |
download | cpython-520403ed4cdf4890d63403c9cf01ac63233f5ef4.zip cpython-520403ed4cdf4890d63403c9cf01ac63233f5ef4.tar.gz cpython-520403ed4cdf4890d63403c9cf01ac63233f5ef4.tar.bz2 |
gh-115733: Fix crash involving exhausted list iterator (#115740)
* gh-115733: Fix crash involving exhausted iterator
* Add blurb
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r-- | Python/executor_cases.c.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 2ca54b6..974555c 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -2427,6 +2427,7 @@ _PyListIterObject *it = (_PyListIterObject *)iter; assert(Py_TYPE(iter) == &PyListIter_Type); PyListObject *seq = it->it_seq; + if (seq == NULL) goto deoptimize; if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) goto deoptimize; break; } |