Keep EG(errors) buffer consistent on erealloc failure - #23257
Conversation
Generally you send the PR against the older branch. Good to know that this doesn't cleanly upmerge - if you want to switch this to target 8.5 with the changes for that branch, when upmerging you can just use edorian@5b36391 as the version for master |
|
Well, that added a ton of people to the reviewers list. Sorry for the noise |
|
@edorian I did this too before. Github's UI sucks. When you change the "base" on the website though editing the title, it only change the base you're merging and won't rebase for you automatically so it generates millions of diff. This is indeed very misleading. A suggestion is to draft the PR when doing "dangerous" stuff like changing the base through Github UI so it won't request review for you automatically :) |
Update the error count only after the buffer has been resized and the new entry initialized. This prevents fatal error handling from reading past the buffer if reallocating it triggers an OOM bailout.
5b36391 to
5edfc63
Compare
|
Thank you @LamentXU123, I'll do that next time |
|
That being said, I think this looks good. But since I have no experience in Zend engine I think other's review is way more persuasive and important. |
Update the error count only after the buffer has been resized and the new entry initialized. This prevents fatal error handling from reading past the buffer if reallocating it triggers an OOM bailout.
This zend_bailout path is also present in 8.5, the patch there would look like this?
If this fix is accepted, should I target 8.5 with a different PR, or what's the best workflow for changes that don't cleanly upmerge? I'm inexperienced in this regard.
Edit: Retargeting to 8.5 as @DanielEScherzer suggested
Changes for the master upmerge would be: