We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a17aa5e commit 5ca7deeCopy full SHA for 5ca7dee
src/Symfony/Component/Filesystem/Filesystem.php
@@ -487,8 +487,8 @@ public function tempnam($dir, $prefix)
487
$tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true);
488
489
// 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');
+ // Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability
+ $handle = @fopen($tmpFile, 'x+');
492
493
// If unsuccessful restart the loop
494
if (false === $handle) {
0 commit comments