--- ../generic/tclListObj.c.orig 2021-09-10 06:40:10 UTC +++ ../generic/tclListObj.c @@ -846,11 +846,8 @@ } if (count < 0) { count = 0; - } else if (numElems < first+count || first+count < 0) { - /* - * The 'first+count < 0' condition here guards agains integer - * overflow in determining 'first+count' - */ + } else if (first > INT_MAX - count /* Handle integer overflow */ + || numElems < first+count) { count = numElems - first; }