Opened 6 years ago
Closed 6 years ago
#4275 closed defect (fixed)
Crash in GEOSisEmpty_r
Reported by: | Algunenano | Owned by: | Algunenano |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.4.7 |
Component: | postgis | Version: | 2.4.x |
Keywords: | Cc: |
Description
We've recently had a crash pointing to GEOSisEmpty_r
. Sadly I don't have a coredump nor a test to reproduce it yet, but after looking at the usages of GEOSisEmpty
it looks like https://github.com/postgis/postgis/blob/80cfa0b0c050499518138a4a972a4033f2b347b7/liblwgeom/lwgeom_geos_clean.c#L701 could be the culprit, as it's passing the result of a function that might be NULL to GEOSisEmpty
.
I'll see if I can reproduce it somehow locally.
Change History (6)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
GEOSisEmpty looks like it'll just hand back a return value of '2' if passed a NULL, so not sure if that's it...?
No, it returns 2 if the geos handle (extHandle
) is NULL, but it doesn't check g1
before dereferencing it. None of the other functions does this check, so I understand it's the intended behaviour.
I'm going to check all the usages of GEOSisEmpty
and try to verify that none of them can pass a NULL pointer as geometry.
GEOSisEmpty
looks like it'll just hand back a return value of '2' if passed a NULL, so not sure if that's it...?