You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Use std::vector for MGLMultiPoint coordinate storage #6580
annotationsAnnotations on iOS and macOS or markers on AndroidiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSrefactorrelease blockerBlocks the next final release
MGLMultiPoint represents its coordinates internally as a C array of CLLocationCoordinate2D instances. This was fine at first, because the coordinates were immutable once MGLMultiPoint was created. Making the coordinates mutable (#6565) is forcing us to reckon with manual C memory management. Any errors there could potentially turn into security vulnerabilities.
We should convert the internal _coordinates array into an std::vector<CLLocationCoordinate2D> and let that object handle heap allocations for us. The public coordinates property would be implemented as _coordinates.data(), and pointCount as _coordinates.size(). The upshot is that the memcpy() grunt work in #6565 could be replaced with nothing more than std::vector::reserve() and std::copy_backward().
Putting this on the v3.4.0 milestone. #6565 and #6583 only increase the risk of making an off-by-one error that can’t be detected by unit tests yet could lead to security vulnerabilities.
Re: being on the milestone, the original feature in #6565 was driven by a customer request and is "gravy" of a sort (mmmmm) beyond the focus on 3.4.0, which is runtime styling.
Maybe consider this a loose milestone issue that can be punted on? We can always tighten things up in a point release.
Even if we punt on #6583, I think we should keep this refactoring on the milestone. It’s small and necessary given that we have no tests of this functionality. (Or we can add tests!) #6565 (comment) is illustrative of the murky waters we’re in right now.
annotationsAnnotations on iOS and macOS or markers on AndroidiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOSrefactorrelease blockerBlocks the next final release
Activity
1ec5 commentedon Oct 5, 2016
Putting this on the v3.4.0 milestone. #6565 and #6583 only increase the risk of making an off-by-one error that can’t be detected by unit tests yet could lead to security vulnerabilities.
incanus commentedon Oct 7, 2016
Re: being on the milestone, the original feature in #6565 was driven by a customer request and is "gravy" of a sort (mmmmm) beyond the focus on 3.4.0, which is runtime styling.
Maybe consider this a loose milestone issue that can be punted on? We can always tighten things up in a point release.
/cc @boundsj
1ec5 commentedon Oct 7, 2016
Even if we punt on #6583, I think we should keep this refactoring on the milestone. It’s small and necessary given that we have no tests of this functionality. (Or we can add tests!) #6565 (comment) is illustrative of the murky waters we’re in right now.
boundsj commentedon Oct 24, 2016
Adding
release blockertag due to the safety concerns raised hereboundsj commentedon Nov 14, 2016
This was fixed in #6890