diff options
| -rw-r--r-- | Misc/NEWS | 1 | ||||
| -rw-r--r-- | Python/ceval.c | 2 |
2 files changed, 3 insertions, 0 deletions
@@ -121,6 +121,7 @@ Core and builtins - with and as are now keywords. +- Bug #1664966: Fix crash in exec if Unicode filename can't be decoded. Library ------- diff --git a/Python/ceval.c b/Python/ceval.c index ffdc75b..9e06302 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4202,6 +4202,8 @@ exec_statement(PyFrameObject *f, PyObject *prog, PyObject *globals, else if (PyFile_Check(prog)) { FILE *fp = PyFile_AsFile(prog); char *name = PyString_AsString(PyFile_Name(prog)); + if (name == NULL) + return -1; PyCompilerFlags cf; cf.cf_flags = 0; if (PyEval_MergeCompilerFlags(&cf)) |
