]> granicus.if.org Git - postgis/commit
Fix for bug #2272: shp2pgsql-gui crashes when given filenames with dots.
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 13 Apr 2013 17:36:22 +0000 (17:36 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 13 Apr 2013 17:36:22 +0000 (17:36 +0000)
commit96bcfdc65603828d3e3bc49e1e22b991538b6dab
treefa1b7b2484496250da0abd4e4ac806cc92b4b04b
parent4aeda6540aa330dbf1474b8cc7a229b9165dbd5a
Fix for bug #2272: shp2pgsql-gui crashes when given filenames with dots.

This was a combination of two bugs: firstly, we weren't initialising the
state variable field_names to NULL, and so if the variable happened to
be filled with junk and we were unable to import a shape file, we would
end up freeing a random pointer.

Secondly, shapelib tries to be clever and strip off any file extension
by searching for a "." character from the end of the filename, hence
causing the truncation of the filename. Resolve this by leaving the
.shp/.dbf extension from the file selector in the filename string so
that shapelib does the right thing.

git-svn-id: http://svn.osgeo.org/postgis/trunk@11292 b70326c6-7e19-0410-871a-916f4a2858ee
loader/shp2pgsql-core.c
loader/shp2pgsql-gui.c