[postgis-tickets] [PostGIS] #4369: Buffer overflow in pgsql2shp

PostGIS trac at osgeo.org
Tue Apr 9 00:41:17 PDT 2019


#4369: Buffer overflow in pgsql2shp
------------------------+---------------------
 Reporter:  gabrimonfa  |      Owner:  pramsey
     Type:  defect      |     Status:  new
 Priority:  medium      |  Milestone:
Component:  postgis     |    Version:  2.5.x
 Keywords:              |
------------------------+---------------------
 OS: Ubuntu 18.10 cosmic 64bit
 RELEASE: 2.5.2 (r17328)

 {{{
 pgsql2shp -h host -u user -f /tmp/file.shp database
 Initializing...
 *** buffer overflow detected ***: pgsql2shp terminated
 }}}

 The table has a lot of fields, many with similar names.\\
 I've made some analysis manually selecting the fields in the command.\\
 The problem seems to be a text field that in some rows is longer than 255
 characters. Let's call that field long_field.

 Tests made:
   * SELECT * FROM table - FAILS
   * SELECT <all fields except long_field> FROM table - OK
   * SELECT <all fields except long_field>, substring(long_field from 0 to
 255) as long_field FROM table - OK
   * SELECT <all fields except long_field>, substring(long_field from 0 to
 256) as long_field FROM table - FAILS

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