1. Armin Rigo
  2. cpython-withatomic

Commits

Georg Brandl  committed 8bad1bf

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

  • Participants
  • Parent commits 152ae71
  • Branches 2.4

Comments (0)

Files changed (1)

File Python/bltinmodule.c

View file
 	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)