From 4961ef70862c62accdcd9870407eda5908839034 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 29 Mar 2000 18:30:03 +0000 Subject: [PATCH] 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. --- Python/ceval.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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) { -- 2.50.1