From 031c16dd3cd6a8b7b85a747225899d34898ef0a8 Mon Sep 17 00:00:00 2001 From: ccrause Date: Sat, 5 Nov 2022 11:19:58 +0200 Subject: [PATCH] Fix potential overflow when incrementing 8 bit high value of res. --- rtl/inc/generic.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/inc/generic.inc b/rtl/inc/generic.inc index 3dd673275b..6bc4ba7f3c 100644 --- a/rtl/inc/generic.inc +++ b/rtl/inc/generic.inc @@ -1265,7 +1265,7 @@ var len: byte; begin l:=high(arr)+1; - if l>=high(res)+1 then + if l>=ObjpasInt(high(res))+1 then l:=high(res) else if l<0 then l:=0;