diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-02-25 16:19:21 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-02-25 16:19:21 +0000 |
commit | a5f5f147834419c9c2c76b468c16d83f68fc1102 (patch) | |
tree | 9fe2081a5d1fe970e4090ca6a9026f7473e7a564 /Python/ceval.c | |
parent | d621a6e8dc7ca155632ba4d1d8c467839427e7d5 (diff) | |
download | cpython-git-a5f5f147834419c9c2c76b468c16d83f68fc1102.tar.gz |
Backport 53901 and 53902 to prevent crash when there is an error decoding unicode filenames
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 7884051ffb..1ee0f3b603 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4173,6 +4173,8 @@ exec_statement(PyFrameObject *f, PyObject *prog, PyObject *globals, FILE *fp = PyFile_AsFile(prog); char *name = PyString_AsString(PyFile_Name(prog)); PyCompilerFlags cf; + if (name == NULL) + return -1; cf.cf_flags = 0; if (PyEval_MergeCompilerFlags(&cf)) v = PyRun_FileFlags(fp, name, Py_file_input, globals, |