Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ee43234

Browse files
committed
Fix mode
1 parent f6771a8 commit ee43234

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
@@ -482,8 +482,8 @@ public function tempnam($dir, $prefix)
482482
$tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true);
483483

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

488488
// If unsuccessful restart the loop
489489
if (false === $handle) {

0 commit comments

Comments
 (0)