Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
efiring merged 5 commits intomatplotlib:masterfromtacaswell:mnt_c_tkblit_bounds
Jul 5, 2019

Conversation

tacaswell
Copy link
Member

As suggested by@cgohlke

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 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

@tacaswelltacaswell added this to thev3.2.0 milestoneJun 7, 2019
(0, 2, 1, 6),
):
with pytest.raises(ValueError):
print(bad_boxes)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the print?

@@ -67,6 +67,12 @@ static PyObject *mpl_tk_blit(PyObject *self, PyObject *args)
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
Contributor

Choose a reason for hiding this comment

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

extra space after width?

@tacaswell
Copy link
MemberAuthor

I still can write code I swear...

@tacaswell
Copy link
MemberAuthor

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

@anntzer
Copy link
Contributor

quite possibly, indeed, looks like a good idea.

Copy link
Member

@timhoffmtimhoffm left a comment

Choose a reason for hiding this comment

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

Minor comment, but would also be ok without.

@@ -67,6 +67,11 @@ static PyObject *mpl_tk_blit(PyObject *self, PyObject *args)
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
Member

Choose a reason for hiding this comment

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

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. 😄

Copy link
MemberAuthor

@tacaswelltacaswellJul 5, 2019
edited
Loading

Choose a reason for hiding this comment

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

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

Moot now that@efiring merged it..

@efiringefiring merged commit0654800 intomatplotlib:masterJul 5, 2019
@tacaswelltacaswell deleted the mnt_c_tkblit_bounds branchJuly 5, 2019 22:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer left review comments

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

4 participants
@tacaswell@anntzer@timhoffm@efiring

[8]ページ先頭

©2009-2025 Movatter.jp