[Pkg-owncloud-commits] [owncloud] 02/95: Check directory handle before we use it

David Prévot taffit at moszumanska.debian.org
Wed Mar 11 15:49:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.1
in repository owncloud.

commit c5a87c2a1889e4f89701a965a0e8a6aa2d3d68fc
Author: Robin Appelman <icewind at owncloud.com>
Date:   Mon Feb 9 12:36:18 2015 +0100

    Check directory handle before we use it
---
 lib/private/tempmanager.php | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/private/tempmanager.php b/lib/private/tempmanager.php
index a3bb07f..60b9c9d 100644
--- a/lib/private/tempmanager.php
+++ b/lib/private/tempmanager.php
@@ -132,12 +132,14 @@ class TempManager implements ITempManager {
 		$cutOfTime = time() - 3600;
 		$files = array();
 		$dh = opendir($this->tmpBaseDir);
-		while (($file = readdir($dh)) !== false) {
-			if (substr($file, 0, 7) === 'oc_tmp_') {
-				$path = $this->tmpBaseDir . '/' . $file;
-				$mtime = filemtime($path);
-				if ($mtime < $cutOfTime) {
-					$files[] = $path;
+		if ($dh) {
+			while (($file = readdir($dh)) !== false) {
+				if (substr($file, 0, 7) === 'oc_tmp_') {
+					$path = $this->tmpBaseDir . '/' . $file;
+					$mtime = filemtime($path);
+					if ($mtime < $cutOfTime) {
+						$files[] = $path;
+					}
 				}
 			}
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list