Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Fix segfault resulting from an invalid geometry. - #16409

Merged
tmpsantos merged 2 commits into
mapbox:masterfrom
stadiamaps:master
Apr 17, 2020
Merged

tmpsantos merged 2 commits into
mapbox:masterfrom
stadiamaps:master

Conversation

@lseelenbinder

@lseelenbinder lseelenbinder commented Apr 16, 2020 •

Copy link
Copy Markdown
Contributor

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • apply needs changelog label if a changelog is needed (remove label when added)

The current implementation of SymbolLayout::addFeature can segfault on an invalid LineString (containing a Line with no members). This skips adding invalid geometries (i.e., LineStrings) when encountered.

This is a trivial bug to verify based on reading the code. I'm happy to add a test case, if someone can point me to the right place.

@pozdnyakov pozdnyakov left a comment

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.

Thanks for catching this! LGTM % nit

Comment thread src/mbgl/layout/symbol_layout.cpp Resolved
@tmpsantos

Copy link
Copy Markdown
Contributor

I kicked the CI bots. 🤖

@chloekraw

chloekraw commented Apr 22, 2020 •

Copy link
Copy Markdown
Contributor

@lseelenbinder thanks for catching this!

@tmpsantos @pozdnyakov where can @lseelenbinder add the test? Are there other invalid geometries that we should skip?

@tmpsantos

Copy link
Copy Markdown
Contributor

@lseelenbinder I merged before you could add a test for this PR. Do you have one?

@lseelenbinder

Copy link
Copy Markdown
Contributor Author

I don't, @tmpsantos. I wasn't sure where such a test should go in the testing apparatus. :)

@tmpsantos

Copy link
Copy Markdown
Contributor

@lseelenbinder it could be a unit test using gtest. They are inside /test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants