diff --git a/packages/fcl-process/src/processbody.inc b/packages/fcl-process/src/processbody.inc index d07a2839a7..7737162a64 100644 --- a/packages/fcl-process/src/processbody.inc +++ b/packages/fcl-process/src/processbody.inc @@ -492,7 +492,7 @@ begin begin if (BytesRead + available > DataLength) then begin - DataLength:=BytesRead + READ_BYTES; + DataLength:=BytesRead + max(READ_BYTES,available); Setlength(Data,DataLength); end; NumBytes := p.Read(data[1+BytesRead], Available);