Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 12110:92ec78e217d2 legacy-trunk
eval_code2(): In the extended calling syntax opcodes, you must check
the return value of PySequence_Length(). If an exception occurred,
the returned length will be -1. Make sure this doesn't get obscurred,
and that the bogus length isn't used.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Wed, 29 Mar 2000 18:30:03 +0000 |
| parents | 603db0d0aed1 |
| children | e2b02d40a142 |
line wrap: on
line diff
--- a/Python/ceval.c Wed Mar 29 16:02:45 2000 +0000 +++ b/Python/ceval.c Wed Mar 29 18:30:03 2000 +0000 @@ -1636,6 +1636,14 @@ break; } nstar = PySequence_Length(stararg); + if (nstar < 0) { + if (!PyErr_Occurred) + PyErr_SetString( + PyExc_TypeError, + "len() of unsized object"); + x = NULL; + break; + } } if (nk > 0) { if (kwdict == NULL) {
