[postgis-tickets] [PostGIS] #2185: Geometry output functions crash server with invalid WKT

PostGIS trac at osgeo.org
Sun May 19 21:59:38 PDT 2013


#2185: Geometry output functions crash server with invalid WKT
------------------------+---------------------------------------------------
 Reporter:  mwtoews     |       Owner:  pramsey      
     Type:  defect      |      Status:  new          
 Priority:  blocker     |   Milestone:  PostGIS 2.0.4
Component:  postgis     |     Version:  2.0.x        
 Keywords:  windows 64  |  
------------------------+---------------------------------------------------

Comment(by robe):

 dustymugs -- thanks.  FWIW I've isolated the problem areas down to:

 http://postgis.net/docs/doxygen/2.1/d9/d6e/lwgeom__inout_8c_source.html#l00066
 (line 66 of lwgeom_inout)

 {{{
 SELECT ST_AsText('');  -- will trigger that part

 }}}
 and I can prevent it from crashing if I replace:

 {{{
    //ereport(ERROR,(errmsg("parse error - invalid geometry")));
    lwerror("parse error2 - invalid geometry");
    PG_RETURN_NULL();
 }}}


 It also triggers at:
 http://postgis.net/docs/doxygen/2.1/d9/d6e/lwgeom__inout_8c_source.html#l00108

 {{{
  if ( lwgeom_parse_wkt(&lwg_parser_result, str, LW_PARSER_CHECK_ALL) ==
 LW_FAILURE )
     {
          PG_PARSER_ERROR(lwg_parser_result);
       }
 }}}


 For the inputs that mwtoews mentioned.  That I haven't bothered yet trying
 to fiddle with.


 Other observation -- if I set the functions to STABLE (instead of
 IMMUTABLE) that also seems to be as good as VOLATILE.  So maybe its
 because the STABLE memory event though its polluted may not matter since
 its thrown away anyway.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2185#comment:32>
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-tickets mailing list