Browse Source

Fix potential overflow when incrementing 8 bit high value of res.

ccrause 2 years ago
parent
commit
031c16dd3c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      rtl/inc/generic.inc

+ 1 - 1
rtl/inc/generic.inc

@@ -1265,7 +1265,7 @@ var
  len: byte;
  len: byte;
 begin
 begin
   l:=high(arr)+1;
   l:=high(arr)+1;
-  if l>=high(res)+1 then
+  if l>=ObjpasInt(high(res))+1 then
     l:=high(res)
     l:=high(res)
   else if l<0 then
   else if l<0 then
     l:=0;
     l:=0;