From 0a932b68953c158d40d79ed7324c1fd33f8f11a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Thu, 15 Mar 2001 16:56:36 +0000 Subject: [PATCH] Move _tkinter.c 1.115 into release branch. --- Misc/NEWS | 11 +++++++++++ Modules/_tkinter.c | 11 ++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 0d78e7f9ceaf..f72bc8078a0b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1,3 +1,14 @@ +What's Fixed in Python 2.0.1 +============================ + +Critical Patches (from MoinMoin) + +- Core dumps in _tkinter + +Fixes to bugs reported on SourceForge + +- #117278, #117167: _tkinter + What's New in Python 2.0? ========================= diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 528b04871983..86b5c220e319 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -572,13 +572,13 @@ Tkapp_Call(PyObject *self, PyObject *args) objv = objStore; if (args == NULL) - objc = 0; + /* do nothing */; else if (!PyTuple_Check(args)) { - objc = 1; objv[0] = AsObj(args); if (objv[0] == 0) goto finally; + objc = 1; Tcl_IncrRefCount(objv[0]); } else { @@ -588,6 +588,7 @@ Tkapp_Call(PyObject *self, PyObject *args) objv = (Tcl_Obj **)ckalloc(objc * sizeof(char *)); if (objv == NULL) { PyErr_NoMemory(); + objc = 0; goto finally; } } @@ -599,8 +600,12 @@ Tkapp_Call(PyObject *self, PyObject *args) break; } objv[i] = AsObj(v); - if (!objv[i]) + if (!objv[i]) { + /* Reset objc, so it attempts to clear + objects only up to i. */ + objc = i; goto finally; + } Tcl_IncrRefCount(objv[i]); } } -- 2.47.3