From: Barry Warsaw Date: Wed, 29 Mar 2000 18:30:03 +0000 (+0000) Subject: eval_code2(): In the extended calling syntax opcodes, you must check X-Git-Tag: v1.6a1~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4961ef70862c62accdcd9870407eda5908839034;p=python 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. --- diff --git a/Python/ceval.c b/Python/ceval.c index 7a97771327..7a0895f194 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) {