-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Crash when parsing invalid sprite URL #5723
Conversation
@kkaefer, thanks for your PR! By analyzing the annotation information on this pull request, we identified @lucaswoj, @tmcw and @jfirebaugh to be potential reviewers |
We’d like to pull this into iOS SDK v3.3.1. That may require #5554, which is in a similar vein. |
Ran afl-fuzz on this and couldn't produce any crashes with this path applied. |
FYI.. this is also going to affect Android too. |
@@ -19,13 +19,13 @@ bool isMapboxURL(const std::string& url) { | |||
|
|||
std::vector<std::string> getMapboxURLPathname(const std::string& url) { | |||
std::vector<std::string> pathname; | |||
std::size_t startIndex = protocol.length(); | |||
std::size_t end = url.find_first_of("?#"); | |||
auto startIndex = protocol.length(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I prefer to use explicit types for normal local variables, rather than seeing auto
and then needing to mentally work out what the type must be.
Addresses #5722 |
Updated the iOS and macOS changelogs in a53dfcd. |
Just clarifying that it's actually Android SDK v4.1.1. |
The fix is now in macOS SDK v0.2.1 as well. |
When a style contains a sprite URL that is invalid, Mapbox GL Native crashes when the filename of the sprite URL does not contain a file extension.