summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-09-25 14:11:46 (GMT)
committerGuido van Rossum <guido@python.org>1998-09-25 14:11:46 (GMT)
commit67906af81148617da6638469e97085e7485b17a0 (patch)
treef78b366dc340029f6d950119683951a29b2104d0 /Objects
parentd35c255e44e64db7323ef278dd3c5da35808785f (diff)
downloadcpython-67906af81148617da6638469e97085e7485b17a0.zip
cpython-67906af81148617da6638469e97085e7485b17a0.tar.gz
cpython-67906af81148617da6638469e97085e7485b17a0.tar.bz2
In PyFrame_New(), don't set extras to something derived from code
before code has been checked for validity. Discovered by Vladimir Marangozov.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index a98d68e..5d85445 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -150,7 +150,7 @@ PyFrame_New(tstate, code, globals, locals)
static PyObject *builtin_object;
PyFrameObject *f;
PyObject *builtins;
- int extras = code->co_stacksize + code->co_nlocals;
+ int extras;
if (builtin_object == NULL) {
builtin_object = PyString_InternFromString("__builtins__");
@@ -164,6 +164,7 @@ PyFrame_New(tstate, code, globals, locals)
PyErr_BadInternalCall();
return NULL;
}
+ extras = code->co_stacksize + code->co_nlocals;
if (back == NULL || back->f_globals != globals) {
builtins = PyDict_GetItem(globals, builtin_object);
if (builtins != NULL && PyModule_Check(builtins))