From a96dae7f0f22970833799aa44043355ece05f3d4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 23 Jun 2022 12:57:09 +0000 Subject: Slightly better integer overflow handling in Tcl_ListObjReplace() --- generic/tclListObj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 9bc4e47..88a332f 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -889,7 +889,7 @@ Tcl_ListObjReplace( } if (count < 0) { count = 0; - } else if (first > INT_MAX - count /* Handle integer overflow */ + } else if (count > LIST_MAX /* Handle integer overflow */ || numElems < first+count) { count = numElems - first; -- cgit v0.12