[postgis-tickets] [PostGIS] #2332: ST_GeomFromWKB crashes PostgreSQL server

PostGIS trac at osgeo.org
Thu May 16 07:41:07 PDT 2013


#2332: ST_GeomFromWKB crashes PostgreSQL server
---------------------+------------------------------------------------------
 Reporter:  dbaston  |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  blocker  |   Milestone:  PostGIS 2.0.4
Component:  postgis  |     Version:  2.0.x        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by robe):

 What the frig?

 {{{
 SELECT
 st_geomfromewkb('0104000020E61000000100000001010000008812F4177AE557C040745E6397943D40'::bytea);
 }}}

 Doesn't crash and on closer inspection st_geomfromewkb uses the C
 function? LWGEOMFromWKB which directly calls lwgeom_from_wkb:
 http://postgis.net/docs/doxygen/2.1/d0/d92/lwin__wkb_8c_source.html#l00724


 While The bad ST_GeomFromWKB uses: the C function LWGEOM_from_WKB which
 calls LWGEOMFromWKB
 http://www.postgis.net/docs/doxygen/2.1/da/d94/lwgeom__ogc_8c_source.html#l00790
 and the result check seems to be doing nothing as result is always NULL.
 So what the hell is that doing?

 That aside why isn't this just directly calling lwgeom_from_wkb like the
 good function is?

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2332#comment:4>
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