mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 02:39:27 +02:00
* when checking for stack tainting parameters, verify all locations of every
parameter instead of only the first location (mantis #17590) git-svn-id: trunk@16121 -
This commit is contained in:
parent
1844ff4c01
commit
31dab28eca
@ -3066,6 +3066,7 @@ implementation
|
|||||||
function tabstractprocdef.stack_tainting_parameter(side: tcallercallee): boolean;
|
function tabstractprocdef.stack_tainting_parameter(side: tcallercallee): boolean;
|
||||||
var
|
var
|
||||||
p: tparavarsym;
|
p: tparavarsym;
|
||||||
|
ploc: PCGParalocation;
|
||||||
i: longint;
|
i: longint;
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
@ -3077,10 +3078,20 @@ implementation
|
|||||||
{ check if no parameter is located on the stack }
|
{ check if no parameter is located on the stack }
|
||||||
if is_open_array(p.vardef) or
|
if is_open_array(p.vardef) or
|
||||||
is_array_of_const(p.vardef) then
|
is_array_of_const(p.vardef) then
|
||||||
result:=true;
|
begin
|
||||||
if assigned(p.paraloc[side].location) and
|
result:=true;
|
||||||
(p.paraloc[side].location^.loc=LOC_REFERENCE) then
|
exit;
|
||||||
result:=true;
|
end;
|
||||||
|
ploc:=p.paraloc[side].location;
|
||||||
|
while assigned(ploc) do
|
||||||
|
begin
|
||||||
|
if (ploc^.loc=LOC_REFERENCE) then
|
||||||
|
begin
|
||||||
|
result:=true;
|
||||||
|
exit
|
||||||
|
end;
|
||||||
|
ploc:=ploc^.next;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user