]> granicus.if.org Git - postgis/commitdiff
Use snprintf in building SRID query string
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 2 Oct 2019 18:22:22 +0000 (18:22 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 2 Oct 2019 18:22:22 +0000 (18:22 +0000)
git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17853 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_export.c

index eaee397bca5a81f3edee654b981e00baace17635..4bc16fa000d476a439f303dd54b4d6373cfaeb0e 100644 (file)
@@ -69,10 +69,10 @@ char * getSRSbySRID(int srid, bool short_crs)
        }
 
        if (short_crs)
-               sprintf(query, "SELECT auth_name||':'||auth_srid \
+               snprintf(query, 256, "SELECT auth_name||':'||auth_srid \
                        FROM spatial_ref_sys WHERE srid='%d'", srid);
        else
-               sprintf(query, "SELECT 'urn:ogc:def:crs:'||auth_name||'::'||auth_srid \
+               snprintf(query, 256, "SELECT 'urn:ogc:def:crs:'||auth_name||'::'||auth_srid \
                        FROM spatial_ref_sys WHERE srid='%d'", srid);
 
        err = SPI_exec(query, 1);