MNT: protect from out-of-bounds data access at the c level#14478
Merged
efiring merged 5 commits intomatplotlib:masterfrom Jul 5, 2019
Merged
MNT: protect from out-of-bounds data access at the c level#14478efiring merged 5 commits intomatplotlib:masterfrom
efiring merged 5 commits intomatplotlib:masterfrom
Conversation
anntzer
reviewed
Jun 7, 2019
| (0, 2, 1, 6), | ||
| ): | ||
| with pytest.raises(ValueError): | ||
| print(bad_boxes) |
anntzer
reviewed
Jun 7, 2019
src/_tkagg.cpp
Outdated
| goto exit; | ||
| } | ||
| if (0 > y1 || y1 > y2 || y2 > height || | ||
| 0 > x1 || x1 > x2 || x2 > width ) { |
- due to missing tk libraries - due to qt already being imported
Member
Author
|
I still can write code I swear... |
Member
Author
|
Can probably re-use the |
Contributor
|
quite possibly, indeed, looks like a good idea. |
timhoffm
approved these changes
Jun 16, 2019
Member
timhoffm
left a comment
There was a problem hiding this comment.
Minor comment, but would also be ok without.
| PyErr_SetString(PyExc_ValueError, "Failed to extract Tk_PhotoHandle"); | ||
| goto exit; | ||
| } | ||
| if (0 > y1 || y1 > y2 || y2 > height || 0 > x1 || x1 > x2 || x2 > width) { |
Member
There was a problem hiding this comment.
Suggested change
| if (0 > y1 || y1 > y2 || y2 > height || 0 > x1 || x1 > x2 || x2 > width) { | |
| if (y1 < 0 || y1 > y2 || y2 > height || x1 < 0 || x1 > x2 || x2 > width) { |
I find it easier this way "y1 is smaller than 0 or larger than y2". 0 > y1 sort of ties a knot in my brain. 😄
Member
Author
There was a problem hiding this comment.
That is fair, but having all of the > go the same way is also helpful..
Moot now that @efiring merged it..
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As suggested by @cgohlke
PR Summary
PR Checklist