summaryrefslogtreecommitdiffstats
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-04 03:06:10 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-04 03:06:10 (GMT)
commita34706f101a16eef8e36054d1f405f794d53ac79 (patch)
treec644a54978563e860c623f96c087a761e6a5776a /Modules/_tkinter.c
parentbccd63c389d72d22882264b8e9cf6e8e5911106c (diff)
downloadcpython-a34706f101a16eef8e36054d1f405f794d53ac79.zip
cpython-a34706f101a16eef8e36054d1f405f794d53ac79.tar.gz
cpython-a34706f101a16eef8e36054d1f405f794d53ac79.tar.bz2
Merged revisions 59680-59695 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59686 | guido.van.rossum | 2008-01-04 00:54:04 +0100 (Fri, 04 Jan 2008) | 2 lines Bug #1301: fixed a bad assert in _tkinter. ........ r59687 | raymond.hettinger | 2008-01-04 01:01:15 +0100 (Fri, 04 Jan 2008) | 3 lines Finish-up the struct module optimizations started at the Iceland NFS sprint. ........ r59688 | christian.heimes | 2008-01-04 01:04:52 +0100 (Fri, 04 Jan 2008) | 1 line Fixed #1687: plistlib.py restricts <integer> to Python int when writing ........ r59689 | christian.heimes | 2008-01-04 01:37:34 +0100 (Fri, 04 Jan 2008) | 1 line Bug #1481296: Fixed long(float('nan'))!=0L. ........ r59691 | andrew.kuchling | 2008-01-04 02:15:50 +0100 (Fri, 04 Jan 2008) | 1 line Markup fixes; grammar tweaks ........ r59692 | andrew.kuchling | 2008-01-04 02:16:12 +0100 (Fri, 04 Jan 2008) | 1 line Add items ........ r59694 | christian.heimes | 2008-01-04 02:48:50 +0100 (Fri, 04 Jan 2008) | 1 line Fixed math.copysign() on Windows ........ r59695 | christian.heimes | 2008-01-04 03:03:25 +0100 (Fri, 04 Jan 2008) | 1 line Filled in some XXX comments ........
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 0e93904..97f85f9 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -898,10 +898,12 @@ AsObj(PyObject *value)
/* This #ifdef assumes that Tcl uses UCS-2.
See TCL_UTF_MAX test above. */
#if defined(Py_UNICODE_WIDE) && TCL_UTF_MAX == 3
- Tcl_UniChar *outbuf;
+ Tcl_UniChar *outbuf = NULL;
Py_ssize_t i;
- assert(size < size * sizeof(Tcl_UniChar));
- outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar));
+ size_t allocsize = ((size_t)size) * sizeof(Tcl_UniChar);
+ if (allocsize >= size)
+ outbuf = (Tcl_UniChar*)ckalloc(allocsize);
+ /* Else overflow occurred, and we take the next exit */
if (!outbuf) {
PyErr_NoMemory();
return NULL;