summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-03-29 18:30:03 (GMT)
committerBarry Warsaw <barry@python.org>2000-03-29 18:30:03 (GMT)
commit4961ef70862c62accdcd9870407eda5908839034 (patch)
treec6b6600f1eda9f4023482e195cf1512ccc92011d
parent918429b3b286645884d222b48eea8d7cf8fa7556 (diff)
downloadcpython-4961ef70862c62accdcd9870407eda5908839034.zip
cpython-4961ef70862c62accdcd9870407eda5908839034.tar.gz
cpython-4961ef70862c62accdcd9870407eda5908839034.tar.bz2
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.
-rw-r--r--Python/ceval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 7a97771..7a0895f 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -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) {