Kaydet (Commit) 4aacab4b authored tarafından Georg Brandl's avatar Georg Brandl

backport bug [ 868706 ] Calling builtin function 'eval' from C causes seg fault.

üst 1e2be087
......@@ -479,6 +479,13 @@ builtin_eval(PyObject *self, PyObject *args)
else if (locals == Py_None)
locals = globals;
if (globals == NULL || locals == NULL) {
PyErr_SetString(PyExc_TypeError,
"eval must be given globals and locals "
"when called without a frame");
return NULL;
}
if (PyDict_GetItemString(globals, "__builtins__") == NULL) {
if (PyDict_SetItemString(globals, "__builtins__",
PyEval_GetBuiltins()) != 0)
......
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