Commit 4126f630 authored by Guido van Rossum's avatar Guido van Rossum

Fix bug #1301 -- a bad assert in _tkinter.

parent af0874bb
......@@ -157,6 +157,8 @@ Library
Extension Modules
-----------------
- Bug #1301: Bad assert in _tkinter fixed.
- Bug #1649098: Avoid declaration of zero-sized array declaration in
structure.
......
......@@ -936,10 +936,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment