gh-142884: Fix UAF in `array.array.tofile` with concurrent mutations
the original code precomputed nblocks at the beginning of the function, but when a reentrant writer cleared the array during the first callback, self->ob_item became NULL. The loop continued iterating based on the cached values and dereferenced the null pointer.
- Issue: gh-142884
It is not the first time you are re-creating a PR because a force-push was wrong. Please, in the future, just don't force push. If you want to update your branch, hit the "update branch" button and pull your changes.
It is not the first time you are re-creating a PR because a force-push was wrong. Please, in the future, just don't force push. If you want to update your branch, hit the "update branch" button and pull your changes.
after i rebase upstream/main,there are a lot of commits,so i close the old one,then create a new one
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
after i rebase upstream/main,there are a lot of commits,so i close the old one,then create a new one
Don't rebase upstream/main, just merge main into your branch.
after i rebase upstream/main,there are a lot of commits,so i close the old one,then create a new one
Don't rebase upstream/main, just merge main into your branch.
ok