[postgis-tickets] [SCM] PostGIS branch main updated. 3.1.0rc1-367-gc84b3f9

git at osgeo.org git at osgeo.org
Wed Jul 28 14:14:24 PDT 2021


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, main has been updated
       via  c84b3f996e2eaea3ba3afeecb783113ab16f0982 (commit)
      from  44819691f4a0f8874e6b0cae1893d457c927edfd (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 c84b3f996e2eaea3ba3afeecb783113ab16f0982
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jul 28 14:06:57 2021 -0700

    Catch crash when query somehow sneaks a NULL query into the selectivity calculator, references #4919

diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c
index d41f480..9875ca9 100644
--- a/postgis/gserialized_estimate.c
+++ b/postgis/gserialized_estimate.c
@@ -2244,6 +2244,7 @@ gserialized_sel_internal(PlannerInfo *root, List *args, int varRelid, int mode)
 
 	GBOX search_box;
 	float8 selectivity = 0;
+	Const *otherConst;
 
 	POSTGIS_DEBUGF(2, "%s: entered function", __func__);
 
@@ -2260,7 +2261,15 @@ gserialized_sel_internal(PlannerInfo *root, List *args, int varRelid, int mode)
 		return DEFAULT_ND_SEL;
 	}
 
-	if (!gserialized_datum_get_gbox_p(((Const*)other)->constvalue, &search_box))
+	otherConst = (Const*)other;
+	if ((!otherConst) || otherConst->constisnull)
+	{
+		ReleaseVariableStats(vardata);
+		POSTGIS_DEBUGF(2, "%s: constant argument is NULL", __func__);
+		return DEFAULT_ND_SEL;
+	}
+
+	if (!gserialized_datum_get_gbox_p(otherConst->constvalue, &search_box))
 	{
 		ReleaseVariableStats(vardata);
 		POSTGIS_DEBUGF(2, "%s: search box is EMPTY", __func__);

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

Summary of changes:
 postgis/gserialized_estimate.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list