]> granicus.if.org Git - python/commitdiff
Issue #20515: Fix NULL pointer dereference introduced by issue #20368
authorChristian Heimes <christian@python.org>
Tue, 4 Feb 2014 23:29:17 +0000 (00:29 +0100)
committerChristian Heimes <christian@python.org>
Tue, 4 Feb 2014 23:29:17 +0000 (00:29 +0100)
CID 1167595

Misc/NEWS
Modules/_tkinter.c

index 045be47951c6d3fe539f1c00e469f2f27ef371ca..85321dd729fd575ea00eeae4b99582f92e8458ec 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -45,6 +45,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 #20426: When passing the re.DEBUG flag, re.compile() displays the
index b106b4b901167fa262f36f9a7bd7f43ba411e509..262d679055ff76ade62590d21d66b71d0b954bb6 100644 (file)
@@ -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;