Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix out of bounds array access if nextVertex is called on empty geometry collection #2868

Merged
merged 2 commits into from
Mar 6, 2016
Merged

Conversation

manisandro
Copy link
Member

Fixes a geometry checker crash reported in #13535.

@nyalldawson
Copy link
Collaborator

Mind adding a quick regression test protecting against this too?

@manisandro
Copy link
Member Author

Sure, something like 6e5e7e4?

@nyalldawson
Copy link
Collaborator

Does that test work? I can't see it calling nextVertex? In any case, I'd strongly suggest moving it to testqgsgeometry.cpp to avoid the need for creating a new cpp test file (which slows compilation down)

@manisandro
Copy link
Member Author

Ok (yes, the test works, because isEmpty uses nextVertex - the usage of isEmpty was what actually caused the crash in the geometry checker).

@nyalldawson
Copy link
Collaborator

Ah ok - i should have actually looked at the code ;)

nyalldawson added a commit that referenced this pull request Mar 6, 2016
Fix out of bounds array access if nextVertex is called on empty geometry collection
@nyalldawson nyalldawson merged commit c50161d into qgis:master Mar 6, 2016
@nyalldawson
Copy link
Collaborator

Thank you!

@manisandro manisandro deleted the next_vertex branch March 6, 2016 21:13
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.

2 participants