[fpc-devel] TFile.ReadAllBytes broken in 3.2.4RC1
michael
michael at freepascal.org
Mon Nov 3 01:58:13 CET 2025
On 2025-11-02 20:22, Bart via fpc-devel wrote:
> On Sun, Nov 2, 2025 at 1:58 PM Bart <bartjunk64 at gmail.com> wrote:
>
> > ReadBuffer(Result,0); << second param should be "Size"
>
> Not sure, but this (ReadBuffer(Result,Size);) seems to crash then
> (memory corruption)?
>
> This:
> ReadBuffer(Result[0],Size);
> seems to work OK though.
> (Should be save even if Size is zero, since ReadBuffer does nothing
> then)
Actually, the ReadBuffer(Result,SIze) is broken due to
ReadBuffer(TBytes,Count) being broken.
Compiler does not select the correct overload, but the fix for that has
not been backported.
The solution would be to add offset zero.
Michael.
More information about the fpc-devel
mailing list