diff options
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r-- | Modules/_tkinter.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 07ebadd..005214e 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -2257,7 +2257,11 @@ _tkinter_tkapp_splitlist(TkappObject *self, PyObject *arg) if (!PyArg_Parse(arg, "et:splitlist", "utf-8", &list)) return NULL; - CHECK_STRING_LENGTH(list); + if (strlen(list) >= INT_MAX) { + PyErr_SetString(PyExc_OverflowError, "string is too long"); + PyMem_Free(list); + return NULL; + } if (Tcl_SplitList(Tkapp_Interp(self), list, &argc, &argv) == TCL_ERROR) { PyMem_Free(list); @@ -2328,7 +2332,11 @@ _tkinter_tkapp_split(TkappObject *self, PyObject *arg) if (!PyArg_Parse(arg, "et:split", "utf-8", &list)) return NULL; - CHECK_STRING_LENGTH(list); + if (strlen(list) >= INT_MAX) { + PyErr_SetString(PyExc_OverflowError, "string is too long"); + PyMem_Free(list); + return NULL; + } v = Split(list); PyMem_Free(list); return v; |