This commit is contained in:
Pierre du Plessis 2015-10-19 10:45:30 +02:00
parent a17aa5e091
commit 5ca7dee2fd
1 changed files with 2 additions and 2 deletions

View File

@ -487,8 +487,8 @@ class Filesystem
$tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true);
// Use fopen instead of file_exists as some streams do not support stat
// Use mode 'x' to atomically check existence and create to avoid a TOCTOU vulnerability
$handle = @fopen($tmpFile, 'x');
// Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability
$handle = @fopen($tmpFile, 'x+');
// If unsuccessful restart the loop
if (false === $handle) {