Skip to content
Permalink
Browse files

Improve backtrace of property-involved issues

  • Loading branch information...
muglug committed Aug 14, 2019
1 parent e92896f commit 3d01708c6c02f60fef03b13472119a2d67a321a0
@@ -2872,11 +2872,15 @@ private static function processTaintedness(
$code_location
);
$existing_sink = $codebase->taint->hasExistingSink($method_sink);
foreach ($input_type->sources as $input_source) {
$existing_source = $codebase->taint->hasExistingSource($input_source);
if (IssueBuffer::accepts(
new TaintedInput(
'in path ' . $codebase->taint->getPredecessorPath($input_source)
. ' out path ' . $codebase->taint->getSuccessorPath($method_sink),
'in path ' . $codebase->taint->getPredecessorPath($existing_source ?: $input_source)
. ' out path ' . $codebase->taint->getSuccessorPath($existing_sink ?: $method_sink),
$code_location
),
$statements_analyzer->getSuppressedIssues()
@@ -189,11 +189,11 @@ public function getPredecessorPath(Source $source, array $visited_paths = []) :
$location_summary = $source->code_location->getQuickSummary();
}
if (isset($visited_paths[$source->id])) {
if (isset($visited_paths[$source->id . ' ' . $location_summary])) {
return '';
}
$visited_paths[$source->id] = true;
$visited_paths[$source->id . ' ' . $location_summary] = true;
$source_descriptor = $source->id . ($location_summary ? ' (' . $location_summary . ')' : '');
@@ -221,11 +221,11 @@ public function getSuccessorPath(Sink $sink, array $visited_paths = []) : string
$location_summary = $sink->code_location->getQuickSummary();
}
if (isset($visited_paths[$sink->id])) {
if (isset($visited_paths[$sink->id . ' ' . $location_summary])) {
return '';
}
$visited_paths[$sink->id] = true;
$visited_paths[$sink->id . ' ' . $location_summary] = true;
$sink_descriptor = $sink->id . ($location_summary ? ' (' . $location_summary . ')' : '');

0 comments on commit 3d01708

Please sign in to comment.
You can’t perform that action at this time.