From 529a639669756b77e89d8803892ec55f3004b863 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 30 May 2014 14:28:21 +0300 Subject: [PATCH] Fixed possible integer overflow in getint, getdouble and getboolean too (issue #21552). --- Modules/_tkinter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 808d481889..4aa8594e76 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1894,6 +1894,7 @@ Tkapp_GetInt(PyObject *self, PyObject *args) } if (!PyArg_ParseTuple(args, "s:getint", &s)) return NULL; + CHECK_STRING_LENGTH(s); if (Tcl_GetInt(Tkapp_Interp(self), s, &v) == TCL_ERROR) return Tkinter_Error(self); return Py_BuildValue("i", v); @@ -1914,6 +1915,7 @@ Tkapp_GetDouble(PyObject *self, PyObject *args) } if (!PyArg_ParseTuple(args, "s:getdouble", &s)) return NULL; + CHECK_STRING_LENGTH(s); if (Tcl_GetDouble(Tkapp_Interp(self), s, &v) == TCL_ERROR) return Tkinter_Error(self); return Py_BuildValue("d", v); @@ -1934,6 +1936,7 @@ Tkapp_GetBoolean(PyObject *self, PyObject *args) } if (!PyArg_ParseTuple(args, "s:getboolean", &s)) return NULL; + CHECK_STRING_LENGTH(s); if (Tcl_GetBoolean(Tkapp_Interp(self), s, &v) == TCL_ERROR) return Tkinter_Error(self); return PyBool_FromLong(v); -- 2.50.1