[postgis-tickets] [SCM] PostGIS branch master updated. 413b47356205b181427ccb5a16e86271d00bbd96

git at osgeo.org git at osgeo.org
Thu Jan 9 08:04:56 PST 2020


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  413b47356205b181427ccb5a16e86271d00bbd96 (commit)
      from  64d4a1a69d8aab3ffe7a0db6e0f0e68cb3ef1bb9 (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 413b47356205b181427ccb5a16e86271d00bbd96
Author: Raúl Marín <git at rmr.ninja>
Date:   Wed Jan 8 10:11:35 2020 +0100

    ST_TileEnvelope: Avoid crashing with the old SQL signature
    
    References #4601
    Closes https://github.com/postgis/postgis/pull/530

diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index f866e49..5fa2f39 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2080,6 +2080,16 @@ Datum ST_TileEnvelope(PG_FUNCTION_ARGS)
 	srid = g->srid;
 	lwgeom_free(g);
 
+	if (PG_NARGS() < 4)
+	{
+		/* Avoid crashing with old signature (old sql code with 3 args, new C code with 4) */
+		ereport(ERROR,
+			(errcode(ERRCODE_UNDEFINED_PARAMETER),
+			 errmsg("Missing margin parameter ($4) in C function '%s'", __func__),
+			 errhint("Consider running: SELECT postgis_extensions_upgrade()")));
+		PG_RETURN_POINTER(NULL);
+	}
+
 	margin = PG_GETARG_FLOAT8(4);
 	/* shrinking by more than 50% would eliminate the tile outright */
 	if (margin < -0.5)

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

Summary of changes:
 postgis/lwgeom_functions_basic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list