mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 08:59:27 +02:00
tstringconstnode.changestringtype: fix buffer overrun
Found by asan
This commit is contained in:
parent
2ce3656ed3
commit
6dc47c71fb
@ -1146,8 +1146,8 @@ implementation
|
||||
l:=UnicodeToUtf8(nil,0,PUnicodeChar(pw^.data),len);
|
||||
if l<>len then
|
||||
ReAllocMem(value_str,l);
|
||||
UnicodeToUtf8(value_str,l,PUnicodeChar(pw^.data),len);
|
||||
len:=l-1;
|
||||
UnicodeToUtf8(value_str,PUnicodeChar(pw^.data),l);
|
||||
donewidestring(pw);
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user