freebsd-ports/lang/tcl85/files/patch-bug214205
2021-09-10 07:03:41 +00:00

16 lines
469 B
Text

--- ../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;
}