Kaydet (Commit) 67906af8 authored tarafından Guido van Rossum's avatar Guido van Rossum

In PyFrame_New(), don't set extras to something derived from code

before code has been checked for validity.  Discovered by Vladimir
Marangozov.
üst d35c255e
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment