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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy