Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History::setFiles may crash when reading empty file #1778

Closed
hwiesmann opened this issue Mar 1, 2019 · 1 comment
Closed

History::setFiles may crash when reading empty file #1778

hwiesmann opened this issue Mar 1, 2019 · 1 comment

Comments

@hwiesmann
Copy link

In case one of the files in WRITEPATH.'debugger/debugbar_*.json is empty the method setFiles will crash. The reason for the crash is that History::setFiles does not check if the local variable $contents contains an object before using it in the assignment

files[] = [....];

CodeIgniter 4 version
CodeIgniter4 Alpha 2.

Affected module(s)
History::setFiles.

Expected behavior, and steps to reproduce if appropriate
I do not know how it can happen that files in WRITEPATH.'debugbar' do not have any content. Therefore, I cannot give hints how to reproduce the error of having an empty file in the said directory. Though I suspect that a crash occurred while writing to one of the files and therefore the file was created without any content (or garbage content). But if one of the files is empty the above mentioned bug is visible.

@jim-parry jim-parry added this to the 4.0.0-beta.2 milestone Mar 5, 2019
lonnieezell added a commit that referenced this issue Mar 26, 2019
@atishhamte
Copy link
Contributor

Can you close this as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants