[postgis-tickets] [PostGIS] #3608: Shp2pgsql invalid free when -W UTF-8

PostGIS trac at osgeo.org
Fri Aug 5 06:52:24 PDT 2016


#3608: Shp2pgsql invalid free when -W UTF-8
---------------------+---------------------------
 Reporter:  mattzen  |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS 2.3.0
Component:  postgis  |    Version:  2.2.x
 Keywords:           |
---------------------+---------------------------
 Shp2pgsql crashes with an invalid free when passed a `-W UTF-8` argument
 on the command line and the shapefile contains a code page. This is
 because shp2pgsql assumes that if the `encoding` is the string `UTF-8`
 then the user has not overridden it. If the code page exists in the
 shapefile, the previous value of `encoding` is freed and, if it came from
 a command line argument, it is not heap-allocated.

 The patch in https://github.com/postgis/postgis/pull/111 prevents the
 crash by `strdup`ing the command line argument, but doesn't address the
 wider issue of distinguishing a user-provided "UTF-8" from a default-
 supplied "UTF-8".

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3608>
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