]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Backport r46044 | neal.norwitz]
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 6 Oct 2006 19:09:36 +0000 (19:09 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 6 Oct 2006 19:09:36 +0000 (19:09 +0000)
Fix #132 from Coverity, retval could have been derefed
if a continue inside a try failed.

Python/ceval.c

index a6201b44ce772365c3119a9400be7c65f783bb60..04dda2552c386f4539c99bf412270adaea29763f 100644 (file)
@@ -2142,6 +2142,10 @@ PyEval_EvalFrame(PyFrameObject *f)
 
                case CONTINUE_LOOP:
                        retval = PyInt_FromLong(oparg);
+                       if (!retval) {
+                               x = NULL;
+                               break;
+                       }
                        why = WHY_CONTINUE;
                        goto fast_block_end;