Skip to content

Commit fcca74f

Browse files
committed
fix: the function tempnam could return false
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent db83c52 commit fcca74f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Sign/JSignService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ private function pkcs12Read(JSignParam $params): array
182182
$tempEncriptedOriginal = tempnam(sys_get_temp_dir(), 'original');
183183
$tempEncriptedRepacked = tempnam(sys_get_temp_dir(), 'repacked');
184184
$tempDecrypted = tempnam(sys_get_temp_dir(), 'decripted');
185+
if ($tempDecrypted === false || $tempPassword === false || $tempEncriptedOriginal === false || $tempEncriptedRepacked === false) {
186+
return [];
187+
}
185188
file_put_contents($tempPassword, $password);
186189
file_put_contents($tempEncriptedOriginal, $certificate);
187190
shell_exec(<<<REPACK_COMMAND

0 commit comments

Comments
 (0)