[postgis-tickets] [PostGIS] #3275: ST_GeomFromGeoJsonof invalid GeoJSON with missing type crashes server process
    PostGIS 
    trac at osgeo.org
       
    Sat Sep 12 01:56:44 PDT 2015
    
    
  
#3275: ST_GeomFromGeoJsonof invalid GeoJSON with missing type crashes server
process
-------------------------+---------------------------
  Reporter:  pdmaseberg  |      Owner:  pramsey
      Type:  defect      |     Status:  closed
  Priority:  medium      |  Milestone:  PostGIS 2.1.8
 Component:  postgis     |    Version:  2.1.x
Resolution:  worksforme  |   Keywords:
-------------------------+---------------------------
Changes (by robe):
 * milestone:  PostGIS 2.1.9 => PostGIS 2.1.8
Comment:
 Okay I think I got it.  What you have seems to have gotten managled.  I
 looked at the stack trace you have and constructed this
 {{{
 -- this gives error
 SELECT
 ST_GeomFromGeoJson('{"type":"Point","crs":{"type":""},"coordinates":[-97.3361,37.6914]}');
 -- ERROR:  syntax error at or near ""
 LINE 1: ...int","crs":{"type":""},"coordinates":[-97.3361,37.6914]}');
 }}}
 {{{
 -- this crashes the backend on Ubuntu
 SELECT
 ST_GeomFromGeoJson('{"type":"Point","crs":{"type":""},"coordinates":[-97.3361,37.6914]}');
 }}}
 I don't see a difference between the two at a glance so must be some
 unprintable character
 and with that my postgres crashes on my Ubuntu install.  As luck would
 have it, I do have a windows box that is running 2.1.7 (and it crashes
 there too).
 Whatever the issue is must be fixed in 2.1.8 though because  y windows
 2.2.0dev and windows 2.1.8 installs do not crash.
 {{{ -- on 2.1.8 / 2.2.0 yields
 SELECT
 ST_GeomFromGeoJson('{"type":"Point","crs":{"type":""},"coordinates":[-97.3361,37.6914]}');
 -- yields --
 0101000000E10B93A9825558C02A3A92CB7FD84240
 SELECT
 ST_AsText(ST_GeomFromGeoJson('{"type":"Point","crs":{"type":""},"coordinates":[-97.3361,37.6914]}'));
 --yields
 POINT(-97.3361 37.6914)
 }}}
 So I'm going to mark this as fixed in 2.1.8
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3275#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-tickets
mailing list