diff options
author | Christian Heimes <christian@python.org> | 2014-02-05 00:29:48 +0100 |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2014-02-05 00:29:48 +0100 |
commit | 25ff287dd7a8ed43b99433796f2d1dcf78efa878 (patch) | |
tree | f313edc91ec322c4ea9fd1e12c3afa9ba0d024fc | |
parent | 3b55f0c6226a1a1b56c661246dbbcce1bc2e3d76 (diff) | |
parent | d33491ea76b3898d5fd0fe3ae75e73ea157a7186 (diff) | |
download | cpython-git-25ff287dd7a8ed43b99433796f2d1dcf78efa878.tar.gz |
Issue #20515: Fix NULL pointer dereference introduced by issue #20368
CID 1167595
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | Modules/_tkinter.c | 3 |
2 files changed, 5 insertions, 0 deletions
@@ -24,6 +24,8 @@ Core and Builtins Library ------- +- Issue #20515: Fix NULL pointer dereference introduced by issue #20368. + - Issue #19186: Restore namespacing of expat symbols inside the pyexpat module. - Issue #20053: ensurepip (and hence venv) are no longer affected by the diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index d48fb179f3..af430fba98 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1397,6 +1397,9 @@ varname_converter(PyObject *in, void *_out) if (PyUnicode_Check(in)) { Py_ssize_t size; s = PyUnicode_AsUTF8AndSize(in, &size); + if (s == NULL) { + return 0; + } if (size > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "string is too long"); return 0; |