Project

General

Profile

Actions

Bug #47981

closed

opendir result not checked before calling readdir in class.t3lib_div.php

Added by Fabrice Morin over 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2013-05-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

In function fixPermissions, there is a call to opendir() in order to retrieve a handle passed to readdir(), but this handle is not checked and assumed to be an actual file handler.

This triggers an endless loop in apache error log :

PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /data/www/omegawatches.com/watches/t3lib/class.t3lib_div.php on line 2823, referer: http://www.omegawatches.com/typo3/alt_doc.php?returnUrl=%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php%3Fid%3D543&edit[pages_language_overlay][3310]=edit&overrideVals[pages_language_overlay][sys_language_uid]=8

Someone filed a bug for PHP here : https://bugs.php.net/bug.php?id=63205
But it was answered that the caller must check the validity of the parameters passed to PHP functions (i.e. readdir())

Actions

Also available in: Atom PDF