mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 08:59:13 +02:00
SynEdit: Fix crash (write incorrect memory via pointer in DoGetPhysicalCharWidths / not caught by range check) and 2ndary range-check-error, when linetext has #$00
. Issue #40873
This commit is contained in:
parent
a8651246a0
commit
b38dcaebfc
@ -1160,7 +1160,7 @@ begin
|
|||||||
if ALen = 0 then
|
if ALen = 0 then
|
||||||
exit;
|
exit;
|
||||||
if Length(AResult) < ALen then
|
if Length(AResult) < ALen then
|
||||||
SetLength(AResult, Length(s));
|
SetLength(AResult, ALen);
|
||||||
DoGetPhysicalCharWidths(s, ALen, Index, @AResult[0]);
|
DoGetPhysicalCharWidths(s, ALen, Index, @AResult[0]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user