mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 16:40:48 +02:00
Debugger: Fixed potential crash with writing (system.move) to empty string
git-svn-id: trunk@44004 -
This commit is contained in:
parent
a582592043
commit
366610e42d
@ -209,7 +209,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
SetLength(Result, len);
|
SetLength(Result, len);
|
||||||
Move(Item^.Name.Ptr^, Result[1], len);
|
if len > 0 then
|
||||||
|
Move(Item^.Name.Ptr^, Result[1], len);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGDBMINameValueList.GetValue(const AName: string): string;
|
function TGDBMINameValueList.GetValue(const AName: string): string;
|
||||||
@ -222,7 +223,8 @@ begin
|
|||||||
if item = nil then Exit;
|
if item = nil then Exit;
|
||||||
|
|
||||||
SetLength(Result, Item^.Value.Len);
|
SetLength(Result, Item^.Value.Len);
|
||||||
Move(Item^.Value.Ptr^, Result[1], Item^.Value.Len);
|
if Item^.Value.Len > 0 then
|
||||||
|
Move(Item^.Value.Ptr^, Result[1], Item^.Value.Len);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGDBMINameValueList.GetValuePtr(const AName: string): TPCharWithLen;
|
function TGDBMINameValueList.GetValuePtr(const AName: string): TPCharWithLen;
|
||||||
|
Loading…
Reference in New Issue
Block a user