[Python-checkins] cpython (3.3): Issue #20515: Fix NULL pointer dereference introduced by issue #20368

christian.heimes python-checkins at python.org
Wed Feb 5 00:31:44 CET 2014


http://hg.python.org/cpython/rev/d83ce3a2d954
changeset: 88965:d83ce3a2d954
branch: 3.3
parent: 88960:f8318b069146
user: Christian Heimes <christian at python.org>
date: Wed Feb 05 00:29:17 2014 +0100
summary:
 Issue #20515: Fix NULL pointer dereference introduced by issue #20368
CID 1167595
files:
 Misc/NEWS | 2 ++
 Modules/_tkinter.c | 3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -45,6 +45,8 @@
 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
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1568,6 +1568,9 @@
 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;
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /