Project

General

Profile

Actions

Bug #31478

closed

wrong array check leads leads to segmentation fault in PHP

Added by Tim Wentzlau over 12 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-11-01
Due date:
% Done:

0%

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

Description

In classes.t3lib.parsehtml.php in line 250 there is a wrong check of the array size.

if (count($wrapArr) > 0) {
    $marker = $wrapArr[0] . $marker . $wrapArr[1];
}

if count($wrapArr) returns 1 then php fails with segmentation fault when trying to access $wrapArr1, as there is no element there.

The segmentation fault must be a php bug, but can be circumvented with this fix:

if (count($wrapArr) > 1) {
    $marker = $wrapArr[0] . $marker . $wrapArr[1];
} 


Files

bug_31478.diff (1 KB) bug_31478.diff Tim Wentzlau, 2011-11-02 10:58
bug_31478.diff (1.38 KB) bug_31478.diff Tim Wentzlau, 2011-11-02 11:16
Actions

Also available in: Atom PDF