1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
This commit is contained in:
Matt Brown 2020-11-22 19:45:54 -05:00 committed by Daniil Gentili
parent a0fee98962
commit c165f072df
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -739,29 +739,33 @@ class ArgumentsAnalyzer
}
}
foreach ($args as $argument_offset => $arg) {
foreach ($arg_function_params[$argument_offset] as $i => $function_param) {
if ($function_param->sinks && $statements_analyzer->data_flow_graph instanceof TaintFlowGraph) {
if (!$function_storage || $function_storage->specialize_call) {
$sink = TaintSink::getForMethodArgument(
$cased_method_id,
$cased_method_id,
$argument_offset,
$function_param->location,
$code_location
);
} else {
$sink = TaintSink::getForMethodArgument(
$cased_method_id,
$cased_method_id,
$argument_offset,
$function_param->location
);
if ($statements_analyzer->data_flow_graph instanceof TaintFlowGraph
&& $cased_method_id
) {
foreach ($args as $argument_offset => $_) {
foreach ($arg_function_params[$argument_offset] as $function_param) {
if ($function_param->sinks) {
if (!$function_storage || $function_storage->specialize_call) {
$sink = TaintSink::getForMethodArgument(
$cased_method_id,
$cased_method_id,
$argument_offset,
$function_param->location,
$code_location
);
} else {
$sink = TaintSink::getForMethodArgument(
$cased_method_id,
$cased_method_id,
$argument_offset,
$function_param->location
);
}
$sink->taints = $function_param->sinks;
$statements_analyzer->data_flow_graph->addSink($sink);
}
$sink->taints = $function_param->sinks;
$statements_analyzer->data_flow_graph->addSink($sink);
}
}
}