[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-903-g0ffc9e1c1

git at osgeo.org git at osgeo.org
Wed May 17 11:00:09 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  0ffc9e1c1fea259fed9207785517063b8b6e5ecd (commit)
      from  9ea7418efd73a964327c73447c6feaf98fc41db6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0ffc9e1c1fea259fed9207785517063b8b6e5ecd
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed May 17 19:39:16 2023 +0200

    Fix crash in ST_AsGML when given id is longer than given prefix
    
    Includes regress test.
    References #5384 in master branch (3.4.0dev)

diff --git a/postgis/geography_inout.c b/postgis/geography_inout.c
index 4e62e0b10..ea3c81379 100644
--- a/postgis/geography_inout.c
+++ b/postgis/geography_inout.c
@@ -273,7 +273,7 @@ Datum geography_as_gml(PG_FUNCTION_ARGS)
 	{
 		id_buf = palloc(VARSIZE_ANY_EXHDR(id_text)+1);
 		memcpy(id_buf, VARDATA(id_text), VARSIZE_ANY_EXHDR(id_text));
-		prefix_buf[VARSIZE_ANY_EXHDR(id_text)+1] = '\0';
+		id_buf[VARSIZE_ANY_EXHDR(id_text)+1] = '\0';
 		id = id_buf;
 	}
 
diff --git a/regress/core/out_gml.sql b/regress/core/out_gml.sql
new file mode 100644
index 000000000..6e2bd4099
--- /dev/null
+++ b/regress/core/out_gml.sql
@@ -0,0 +1,5 @@
+-- TODO: move all ST_AsGML tests here
+
+-- #5384
+SELECT '#5384.geom', ST_AsGML('POINT(0 0)'::geometry, 15, 0, '', '1');
+SELECT '#5384.geog', ST_AsGML('POINT(0 0)'::geography, 15, 0, '', '1');
diff --git a/regress/core/out_gml_expected b/regress/core/out_gml_expected
new file mode 100644
index 000000000..bab0eca7b
--- /dev/null
+++ b/regress/core/out_gml_expected
@@ -0,0 +1,2 @@
+#5384.geom|<Point srsName="EPSG:4326"><coordinates>0,0</coordinates></Point>
+#5384.geog|<Point srsName="EPSG:4326"><coordinates>0,0</coordinates></Point>
diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index e1fc968df..3cd590e98 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -67,6 +67,7 @@ TESTS += \
 	$(top_srcdir)/regress/core/out_flatgeobuf \
 	$(top_srcdir)/regress/core/out_geometry \
 	$(top_srcdir)/regress/core/out_geography \
+	$(top_srcdir)/regress/core/out_gml \
 	$(top_srcdir)/regress/core/polygonize \
 	$(top_srcdir)/regress/core/polyhedralsurface \
 	$(top_srcdir)/regress/core/postgis_type_name \

-----------------------------------------------------------------------

Summary of changes:
 postgis/geography_inout.c     | 2 +-
 regress/core/out_gml.sql      | 5 +++++
 regress/core/out_gml_expected | 2 ++
 regress/core/tests.mk.in      | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 regress/core/out_gml.sql
 create mode 100644 regress/core/out_gml_expected


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list