Skip to content

MB-65807: Graceful handling of non-conforming polygon data#2166

Merged
abhinavdangeti merged 2 commits into7.6.x-couchbasefrom
mb65807_bp
Mar 18, 2025
Merged

MB-65807: Graceful handling of non-conforming polygon data#2166
abhinavdangeti merged 2 commits into7.6.x-couchbasefrom
mb65807_bp

Conversation

@abhinavdangeti
Copy link
Member

@abhinavdangeti abhinavdangeti commented Mar 17, 2025

Geo's extract3DCoordinates does not validate input data which can cause malformed polygon data to cause a panic:

panic: reflect: call of reflect.Value.Index on map Value

panic({0x100a9e0c0?, 0x140001163a8?})
        /opt/homebrew/opt/go/libexec/src/runtime/panic.go:770 +0x124
reflect.Value.Index({0x100a9ffe0?, 0x14000118c00?, 0x14000062c58?}, 0x1008913c8?)
        /opt/homebrew/opt/go/libexec/src/reflect/value.go:1447 +0x170
github.com/blevesearch/bleve/v2/geo.extract3DCoordinates({0x100a9ffe0?, 0x14000118c00?})
        /Users/abhinav.dangeti/Documents/go/src/github.com/blevesearch/bleve/geo/parse.go:245 +0x12c
github.com/blevesearch/bleve/v2/geo.ExtractGeoShapeCoordinates({0x100a9ffe0?, 0x14000118c00?}, {0x100a24659, 0x7})

See: https://pkg.go.dev/reflect#Value.IsValid

Geo's "extract3DCoordinates" does not validation input data which
can cause mal-formed polygon data to cause a panic:

panic({0x100a9e0c0?, 0x140001163a8?})
        /opt/homebrew/opt/go/libexec/src/runtime/panic.go:770 +0x124
reflect.Value.Index({0x100a9ffe0?, 0x14000118c00?, 0x14000062c58?}, 0x1008913c8?)
        /opt/homebrew/opt/go/libexec/src/reflect/value.go:1447 +0x170
github.com/blevesearch/bleve/v2/geo.extract3DCoordinates({0x100a9ffe0?, 0x14000118c00?})
        /Users/abhinav.dangeti/Documents/go/src/github.com/blevesearch/bleve/geo/parse.go:245 +0x12c
github.com/blevesearch/bleve/v2/geo.ExtractGeoShapeCoordinates({0x100a9ffe0?, 0x14000118c00?}, {0x100a24659, 0x7})

See: https://pkg.go.dev/reflect#Value.IsValid
@abhinavdangeti abhinavdangeti merged commit fef722d into 7.6.x-couchbase Mar 18, 2025
9 checks passed
@abhinavdangeti abhinavdangeti deleted the mb65807_bp branch March 18, 2025 15:43
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