mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
Merge pull request #6553 from orklah/exec-leak
This commit is contained in:
commit
d232cc0d02
@ -968,8 +968,12 @@ class ArgumentsAnalyzer
|
||||
$function_param = $last_param;
|
||||
}
|
||||
|
||||
$by_ref_type = $function_param->type;
|
||||
$by_ref_out_type = $function_param->out_type;
|
||||
if ($function_param->type) {
|
||||
$by_ref_type = clone $function_param->type;
|
||||
}
|
||||
if ($function_param->out_type) {
|
||||
$by_ref_out_type = clone $function_param->out_type;
|
||||
}
|
||||
|
||||
if ($by_ref_type && $by_ref_type->isNullable()) {
|
||||
$check_null_ref = false;
|
||||
|
@ -1602,6 +1602,22 @@ class FunctionCallTest extends TestCase
|
||||
foo($s);
|
||||
}',
|
||||
],
|
||||
'preventObjectLeakingFromCallmapReference' => [
|
||||
'<?php
|
||||
function one(): void
|
||||
{
|
||||
try {
|
||||
exec("", $output);
|
||||
} catch (Exception $e){
|
||||
}
|
||||
}
|
||||
|
||||
function two(): array
|
||||
{
|
||||
exec("", $lines);
|
||||
return $lines;
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user