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 | 3bffbbffff9ab9ecab9eb0180df112749c836c0e (patch) | |
tree | 3e5ef3fa7d03bec807634edd66926b361ade4411 | |
parent | 5abd3d31aa9cdbf64966b57f7e1e6f375d5158fe (diff) | |
download | cpython-3bffbbffff9ab9ecab9eb0180df112749c836c0e.tar.gz |
Backport 53901 and 53902 to prevent crash when there is an error decoding unicode filenames
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | Python/ceval.c | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -124,6 +124,8 @@ Extension Modules - The version number of the ctypes package was changed to "1.0.2". +- Bug #1664966: Fix crash in exec if Unicode filename can't be decoded. + - Patch #1544279: Improve thread-safety of the socket module by moving the sock_addr_t storage out of the socket object. 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, |