[postgis-tickets] [SCM] PostGIS branch stable-2.4 updated. 667a71a22475f1e348f9ea2304d8be3419e8c5a4

git at osgeo.org git at osgeo.org
Fri Feb 28 04:19:24 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, stable-2.4 has been updated
       via  667a71a22475f1e348f9ea2304d8be3419e8c5a4 (commit)
      from  2ad0ddc501dc4bafa0cbb3f42611a4e92208a134 (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 667a71a22475f1e348f9ea2304d8be3419e8c5a4
Author: Raúl Marín <git at rmr.ninja>
Date:   Fri Feb 28 11:57:54 2020 +0100

    Fix gserialized_cmp incorrect comparison
    
    Patch by dkvash and some tweaks by me
    
    Closes #4646

diff --git a/NEWS b/NEWS
index d4f8075..b9635a2 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ XXXX/XX/XX
   - #4546, Fix PLPGSQL functions missing the schema qualification (Raúl Marín)
   - #4588, Fix update when st_union(geometry) doesn't exist (Raúl Marín)
   - #4621, Prevent stack overflow when parsing WKB (Raúl Marín)
+  - #4646, Fix gserialized_cmp incorrect comparison (dkvash)
 
 
 PostGIS 2.4.8
diff --git a/liblwgeom/g_serialized.c b/liblwgeom/g_serialized.c
index 2f405d5..cc35f31 100644
--- a/liblwgeom/g_serialized.c
+++ b/liblwgeom/g_serialized.c
@@ -306,12 +306,12 @@ int gserialized_cmp(const GSERIALIZED *g1, const GSERIALIZED *g2)
 	if (
 		sz1 > 16 && // 16 is size of EMPTY, if it's larger - it has coordinates
 		sz2 > 16 &&
-		*(uint32_t*)(g1->data) == POINTTYPE &&
-		*(uint32_t*)(g2->data) == POINTTYPE &&
 		!FLAGS_GET_BBOX(g1->flags) &&
 		!FLAGS_GET_GEODETIC(g1->flags) &&
 		!FLAGS_GET_BBOX(g2->flags) &&
-		!FLAGS_GET_GEODETIC(g2->flags)
+		!FLAGS_GET_GEODETIC(g2->flags) &&
+		gserialized_get_type(g1) == POINTTYPE &&
+		gserialized_get_type(g2) == POINTTYPE
 	)
 	{
 		double *dptr = (double*)(g1->data);

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

Summary of changes:
 NEWS                     | 1 +
 liblwgeom/g_serialized.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list