[postgis-devel] [PostGIS] #712: ST_IsValidDetail and ST_IsValidReason POLYGON CRASH

PostGIS trac at osgeo.org
Sun Jun 26 10:28:46 PDT 2011


#712: ST_IsValidDetail and ST_IsValidReason POLYGON CRASH
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by pramsey):

 It looks pretty easy if one knows what the form of a GEOS empty polygon
 is. In the case of LWGEOM, it's coming in with nrings == 0 and **rings ==
 NULL, so it crashes when it tries to dereference rings[0]. Instead of de-
 referencing it should be checking for nrings == 0 and in that case
 constructing an empty polygon.

 It looks like both the LINESTRING and POINT cases work because they are
 going in with a non-null POINTARRAY that has npoints == 0 and
 *serialized_ptlist == NULL. So the GEOS interpretation of "empty" is
 working in those cases. Any help you can provide, appreciated.

 For GEOS 3.3 you've provided nice easy createEmpty signatures, but what
 happened for pre-3.3? We did pass in empty geometry collections, right?
 I've got GEOS 3.2 and it's handling every other empty just fine.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/712#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list