GeometryCollection with strict-winding polygon causes 2dsphere index key generation crash

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.3, 8.2.10, 8.0.24, 7.0.35
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • ALL
    • v8.3, v8.2, v8.0, v7.0
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Inserting a document into a collection with a 2dsphere index crashes the server when the indexed field is a GeoJSON GeometryCollection containing a Polygon with the strict-winding CRS.

      During index key generation, parseFromGeoJSON pushes a null s2Polygon pointer into the S2RegionUnion regions vector, which is later dereferenced in S2RegionUnion::GetRectBound(). A guard already exists to reject top-level strict-winding geometry, but it is bypassed for GeometryCollection because getNativeCRS() unconditionally returns  SPHERE for collections without inspecting their members.

            Assignee:
            Adithi Raghavan
            Reporter:
            Adithi Raghavan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: