UnicodeString SetString procedure does too much and uses uninitialized memory
Original Reporter info from Mantis: Vincent
-
Reporter name: Vincent Snijders
Original Reporter info from Mantis: Vincent
- Reporter name: Vincent Snijders
Description:
The Procedure SetString (Out S : UnicodeString; Buf : PUnicodeChar; Len : SizeInt); uses IndexWord to find the first #0000.
This is incompatible with Delphi and the SetString procedure for AnsiStrings.
If one still decides to keep the IndexWord call, then it should be limited to the first Len UnicodeChar and not Len + 1.
Additional information:
See discussion on fpc-devel list:
http://www.hu.freepascal.org/lists/fpc-devel/2009-October/017682.html
Mantis conversion info:
- Mantis ID: 14740
- OS: Linux
- OS Build: Ubuntu 9.04
- Platform: i386
- Fixed in version: 2.4.2
- Fixed in revision: 15186 (#23143b85)