id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 3608,Shp2pgsql invalid free when -W UTF-8,Matt Amos,pramsey,"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"".",defect,closed,medium,PostGIS 2.2.3,postgis,2.2.x,fixed,,