Browse Source

Typecasting to int64 type fixes the exception.

Yuri 3 years ago
parent
commit
aa82a2e446
1 changed files with 2 additions and 3 deletions
  1. 2 3
      packages/fcl-web/src/websocket/fpwebsocket.pp

+ 2 - 3
packages/fcl-web/src/websocket/fpwebsocket.pp

@@ -995,9 +995,8 @@ begin
     TWSFramePayload.CopyMasked(Payload.Data,Buffer,Payload.MaskKey,aOffset);
     end
   else
-    if Payload.DataLength > 0 then
-      for I:=0 to Payload.DataLength-1 do
-        buffer[aOffset + I]:=Payload.Data[I];
+    for I:=0 to int64(Payload.DataLength)-1 do
+      buffer[aOffset + I]:=Payload.Data[I];
 
   Result := Buffer;
 end;