Opened 6 years ago

Closed 5 years ago

#4369 closed defect (worksforme)

Buffer overflow in pgsql2shp

Reported by: gabrimonfa Owned by: pramsey
Priority: medium Milestone: PostGIS 2.5.3
Component: postgis Version: 2.5.x -- EOL
Keywords: Cc:

Description

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

Change History (2)

comment:1 by Algunenano, 6 years ago

Milestone: PostGIS 2.5.3

Can you provide a straightforward way to reproduce the issue, please?

comment:2 by pramsey, 5 years ago

Resolution: worksforme
Status: newclosed

Need a reproduction case for this. Closing for now.

Note: See TracTickets for help on using tickets.