mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Taint can't transmit through numerics nor bool
This commit is contained in:
parent
3bc06a8eab
commit
ab61eae5c9
@ -12,6 +12,7 @@ use Psalm\Context;
|
|||||||
use Psalm\Internal\Analyzer\FunctionLike\ReturnTypeAnalyzer;
|
use Psalm\Internal\Analyzer\FunctionLike\ReturnTypeAnalyzer;
|
||||||
use Psalm\Internal\Analyzer\FunctionLike\ReturnTypeCollector;
|
use Psalm\Internal\Analyzer\FunctionLike\ReturnTypeCollector;
|
||||||
use Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer;
|
use Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer;
|
||||||
|
use Psalm\Internal\Codebase\TaintFlowGraph;
|
||||||
use Psalm\Internal\DataFlow\DataFlowNode;
|
use Psalm\Internal\DataFlow\DataFlowNode;
|
||||||
use Psalm\Internal\FileManipulation\FunctionDocblockManipulator;
|
use Psalm\Internal\FileManipulation\FunctionDocblockManipulator;
|
||||||
use Psalm\Internal\Type\Comparator\TypeComparisonResult;
|
use Psalm\Internal\Type\Comparator\TypeComparisonResult;
|
||||||
@ -1032,7 +1033,9 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer
|
|||||||
if ($statements_analyzer->data_flow_graph
|
if ($statements_analyzer->data_flow_graph
|
||||||
&& $function_param->location
|
&& $function_param->location
|
||||||
) {
|
) {
|
||||||
if ($function_param->type === null
|
//don't add to taint flow graph if the type can't transmit taints
|
||||||
|
if (!$statements_analyzer->data_flow_graph instanceof TaintFlowGraph
|
||||||
|
|| $function_param->type === null
|
||||||
|| !$function_param->type->isSingle()
|
|| !$function_param->type->isSingle()
|
||||||
|| (!$function_param->type->isInt()
|
|| (!$function_param->type->isInt()
|
||||||
&& !$function_param->type->isFloat()
|
&& !$function_param->type->isFloat()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user