[fpc-pascal] Unicodestrings and Assign(File)
Jürgen Hestermann
juergen.hestermann at gmx.de
Sun May 20 14:40:53 CEST 2012
In "fpc\rtl\inc\file.inc" (and fpc\fpc\rtl\inc\text.inc) the declaration
of "Assign"
uses the generic "String" type for the file name. I think this can be
AnsiString too, so it may be longer than 255 characters.
But the assignment to the internal *rec element "name" (which
is "array[0..255] of char") is done with
Move(s[1],TextRec(t).Name,Length(s));
That would be a bug IMO when S is longer than 255 characters.
"Move" does no range check.
More information about the fpc-pascal
mailing list