8000 Fix mode · symfony/symfony@5ca7dee · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ca7dee

Browse files
committed
Fix mode
1 parent a17aa5e commit 5ca7dee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ public function tempnam($dir, $prefix)
487487
$tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true);
488488

489489
// Use fopen instead of file_exists as some streams do not support stat
490-
// Use mode 'x' to atomically check existence and create to avoid a TOCTOU vulnerability
491-
$handle = @fopen($tmpFile, 'x');
490+
// Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability
491+
$handle = @fopen($tmpFile, 'x+');
492492

493493
// If unsuccessful restart the loop
494494
if (false === $handle) {

0 commit comments

Comments
 (0)
0