FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MNT: protect from out-of-bounds data access at the c level by tacaswell · Pull Request #14478 · matplotlib/matplotlib · GitHub

Repository navigation

MNT: protect from out-of-bounds data access at the c level - #14478

Merged
efiring merged 5 commits into
matplotlib:masterfrom
tacaswell:mnt_c_tkblit_bounds
Jul 5, 2019
Merged

efiring merged 5 commits into
matplotlib:masterfrom
tacaswell:mnt_c_tkblit_bounds

Conversation

Copy link
Copy Markdown
Member

As suggested by @cgohlke

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

tacaswell added this to the v3.2.0 milestone Jun 7, 2019
Comment thread lib/matplotlib/tests/test_backend_tk.py Outdated
(0, 2, 1, 6),
):
with pytest.raises(ValueError):
print(bad_boxes)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

remove the print?

Comment thread src/_tkagg.cpp Outdated
goto exit;
}
if (0 > y1 || y1 > y2 || y2 > height ||
0 > x1 || x1 > x2 || x2 > width ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

extra space after width?

Copy link
Copy Markdown
Member Author

I still can write code I swear...

Copy link
Copy Markdown
Member Author

Can probably re-use the skip_on_importfailure flag to further simplify the Qt tests?

anntzer commented Jun 10, 2019

Copy link
Copy Markdown
Contributor

quite possibly, indeed, looks like a good idea.

timhoffm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Minor comment, but would also be ok without.

Comment thread src/_tkagg.cpp
PyErr_SetString(PyExc_ValueError, "Failed to extract Tk_PhotoHandle");
goto exit;
}
if (0 > y1 || y1 > y2 || y2 > height || 0 > x1 || x1 > x2 || x2 > width) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
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. 😄

tacaswell Jul 5, 2019 •
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That is fair, but having all of the > go the same way is also helpful..

Moot now that @efiring merged it..

efiring merged commit 0654800 into matplotlib:master Jul 5, 2019
tacaswell deleted the mnt_c_tkblit_bounds branch July 5, 2019 22:38
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL