-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: Harden files scanner for invalid null access #50436
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
Conversation
|
/backport to stable31 |
|
Stable30 and stable29 differ a bit, so their PR is here: #50437 |
c53892b to
12d0806
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| $cacheData = $cacheData ?? $this->cache->get($file); | ||
| if ($reuseExisting && $cacheData !== false && isset($cacheData['fileid'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory $cacheData can never be null based on the logic and the return type of Cache::get(), but looking at the backing code I wouldn't be so sure that it really never returns null, so maybe add a check for null as well.
| $data['fileid'] = $this->addToCache($file, $newData, $fileId); | ||
| } | ||
|
|
||
| if ($cacheData !== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here again, maybe check for null as well.
484b509 to
53815b3
Compare
3ed5a56 to
75fb094
Compare
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
578af46 to
b48ee2e
Compare
Summary
Checklist