summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/_tkinter.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 0bf92fd..594b947 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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 d48fb17..af430fb 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;