summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2014-02-04 23:29:17 (GMT)
committerChristian Heimes <christian@python.org>2014-02-04 23:29:17 (GMT)
commitd33491ea76b3898d5fd0fe3ae75e73ea157a7186 (patch)
treea1c9935ce305c58834fb1f358a375ef3178a1b77 /Modules/_tkinter.c
parent6068b6c977ad30349b6c747109b8748674ec4918 (diff)
downloadcpython-d33491ea76b3898d5fd0fe3ae75e73ea157a7186.zip
cpython-d33491ea76b3898d5fd0fe3ae75e73ea157a7186.tar.gz
cpython-d33491ea76b3898d5fd0fe3ae75e73ea157a7186.tar.bz2
Issue #20515: Fix NULL pointer dereference introduced by issue #20368
CID 1167595
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index b106b4b..262d679 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1568,6 +1568,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;