]> granicus.if.org Git - python/commitdiff
Fixed possible integer overflow in getint, getdouble and getboolean too (issue #21552).
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 30 May 2014 11:28:21 +0000 (14:28 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 30 May 2014 11:28:21 +0000 (14:28 +0300)
Modules/_tkinter.c

index 808d48188932d93f82719d5ba6acbfceadb5bedc..4aa8594e765116a2817d64242f0d2c63d6d68e4f 100644 (file)
@@ -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);