[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.9-14-g04ec7aee9
git at osgeo.org
git at osgeo.org
Mon Sep 18 12:35:02 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, stable-3.1 has been updated
via 04ec7aee9a3425b70e9da91f4cb6fd17511bf9a0 (commit)
via 959988faa481ce6c30d8f63674c78825be1654dc (commit)
from a4249be7ff1d8a289d1ffe1ad361c3faf78f71ff (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 04ec7aee9a3425b70e9da91f4cb6fd17511bf9a0
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Mon Sep 18 12:34:50 2023 -0700
Remove accidentally added file
diff --git a/postgis/lwgeom_export.c.rej b/postgis/lwgeom_export.c.rej
deleted file mode 100644
index 78172f6be..000000000
--- a/postgis/lwgeom_export.c.rej
+++ /dev/null
@@ -1,8 +0,0 @@
-@@ -286,6 +286,7 @@
- GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
- LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
- const char *srs = NULL;
-+ char *cstr;
- lwvarlena_t *geojson;
- if (lwgeom->srid != SRID_UNKNOWN)
- {
commit 959988faa481ce6c30d8f63674c78825be1654dc
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Mon Sep 18 12:34:12 2023 -0700
Avoid reading past the end of varlena_t data buffer
diff --git a/NEWS b/NEWS
index 2f20fd86b..66b15dfd2 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ xxxx/xx/xx
(Bas Couwenberg)
- #5385, Postgres malloc assertion fail when using pg_cancel_backend
with ST_AsMVT (Regina Obe, Paul Ramsey)
+ - Fix JsonB casting issue (Paul Ramsey)
+
* Breaking Changes *
- #5385, Take out interruptability of ST_AsMVT
diff --git a/postgis/lwgeom_export.c b/postgis/lwgeom_export.c
index 5f6588c10..a7a864549 100644
--- a/postgis/lwgeom_export.c
+++ b/postgis/lwgeom_export.c
@@ -278,9 +278,12 @@ Datum geometry_to_jsonb(PG_FUNCTION_ARGS)
{
GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
+ char *cstr = NULL;
lwvarlena_t *geojson = lwgeom_to_geojson(lwgeom, NULL, 15, 0);
lwgeom_free(lwgeom);
- PG_RETURN_DATUM(DirectFunctionCall1(jsonb_in, PointerGetDatum(text_to_cstring(geojson))));
+ cstr = palloc0(VARSIZE_ANY_EXHDR(geojson) + 1);
+ memcpy(cstr, VARDATA(geojson), VARSIZE_ANY_EXHDR(geojson));
+ PG_RETURN_DATUM(DirectFunctionCall1(jsonb_in, PointerGetDatum(cstr)));
}
diff --git a/postgis/lwgeom_export.c.rej b/postgis/lwgeom_export.c.rej
new file mode 100644
index 000000000..78172f6be
--- /dev/null
+++ b/postgis/lwgeom_export.c.rej
@@ -0,0 +1,8 @@
+@@ -286,6 +286,7 @@
+ GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
+ LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
+ const char *srs = NULL;
++ char *cstr;
+ lwvarlena_t *geojson;
+ if (lwgeom->srid != SRID_UNKNOWN)
+ {
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 ++
postgis/lwgeom_export.c | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list