Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6771a8 commit ee43234Copy full SHA for ee43234
src/Symfony/Component/Filesystem/Filesystem.php
@@ -482,8 +482,8 @@ public function tempnam($dir, $prefix)
482
$tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true);
483
484
// 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');
+ // Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability
+ $handle = @fopen($tmpFile, 'x+');
487
488
// If unsuccessful restart the loop
489
if (false === $handle) {
0 commit comments