Project

General

Profile

Actions

Bug #88879

closed

ContentObjectRenderer->imageLinkWrap could fail if ResourceFactory returns NULL instead of File

Added by Kevin Ditscheid over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2019-08-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

This line https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L1319 could fail, if the ResourceFactory returned NULL earlier in execution at https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L1290

It should probably be hardened, so this possibility of a NULL value is respected instead of the code breaking.

Actions #1

Updated by Frank Nägler over 4 years ago

  • Status changed from New to Needs Feedback

Can you please post a stack trace or some more details.
The mentioned lines make no sense.

Actions #2

Updated by Kevin Ditscheid over 4 years ago

Give the imageLinkWrap function a file in a processed directory. typo3temp/assets/_processed_/somefile.jpg for example.
The ResourceFactory will return NULL and all the stuff will fall apart, because there is no File object created and the successfull creation of that object is never checked.
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Resource/ResourceFactory.php#L426

Actions #3

Updated by Kevin Ditscheid over 4 years ago

Also, if you give it a ProcessedFile object, it will complain about the identifier later in execution.

Actions #4

Updated by Gerrit Code Review about 4 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63914

Actions #5

Updated by Gerrit Code Review about 4 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63904

Actions #6

Updated by Susanne Moog about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF