mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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.
This commit is contained in:
parent
918429b3b2
commit
4961ef7086
1 changed files with 8 additions and 0 deletions
|
@ -1636,6 +1636,14 @@ eval_code2(co, globals, locals,
|
|||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue