[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-135-g022f6ea

git at osgeo.org git at osgeo.org
Sun Apr 11 11:34:06 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, master has been updated
       via  022f6eaac6d05b5d70578075086b0998684f78ac (commit)
       via  9773307ee16c9a0f2d970e87ba444b18bae02290 (commit)
       via  9bb03f8a2a86517db06fd695fd9a1891645fdeba (commit)
       via  4f653e76d48e93a81b6aa2a9d399154503e3e340 (commit)
       via  6650f487b0c30fc1ae1ab816574b650b4882971e (commit)
      from  b3659c0b0c9cfe935a249e3b89d3047d45d169c9 (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 022f6eaac6d05b5d70578075086b0998684f78ac
Merge: b3659c0 9773307
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Sun Apr 11 11:34:01 2021 -0700

    Merge branch 'rouault-liblwgeom_cppcheck'


commit 9773307ee16c9a0f2d970e87ba444b18bae02290
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sun Apr 11 15:45:42 2021 +0200

    _lwt_EdgeRingIterator_begin(): avoid nullptr dereference when er->size == 0

diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c
index b86ff07..2c7d3fd 100644
--- a/liblwgeom/lwgeom_topo.c
+++ b/liblwgeom/lwgeom_topo.c
@@ -6197,7 +6197,7 @@ _lwt_EdgeRingIterator_begin(LWT_EDGERING *er)
   if ( er->size ) ret->curelem = er->elems[0];
   else ret->curelem = NULL;
   ret->curelemidx = 0;
-  ret->curidx = ret->curelem->left ? 0 : ret->curelem->edge->geom->points->npoints - 1;
+  ret->curidx = (ret->curelem == NULL || ret->curelem->left) ? 0 : ret->curelem->edge->geom->points->npoints - 1;
   return ret;
 }
 

commit 9bb03f8a2a86517db06fd695fd9a1891645fdeba
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sun Apr 11 15:45:11 2021 +0200

    lwgeom_topo.c: add missing return in error code path, that could otherwise call a nullptr dereference due to pa being NULL

diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c
index 7ec18bb..b86ff07 100644
--- a/liblwgeom/lwgeom_topo.c
+++ b/liblwgeom/lwgeom_topo.c
@@ -4499,6 +4499,7 @@ _lwt_HealEdges( LWT_TOPOLOGY* topo, LWT_ELEMID eid1, LWT_ELEMID eid2,
       e2sign = 0;
       _lwt_release_edges(edges, nedges);
       lwerror("Coding error: caseno=%d should never happen", caseno);
+      return -1;
       break;
   }
   newedge.geom = lwline_construct(topo->srid, NULL, pa);

commit 4f653e76d48e93a81b6aa2a9d399154503e3e340
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sun Apr 11 15:44:17 2021 +0200

    Use va_copy() / va_end() since we already used va_end(ap2) before

diff --git a/liblwgeom/stringbuffer.c b/liblwgeom/stringbuffer.c
index 9babf0a..d71d5f1 100644
--- a/liblwgeom/stringbuffer.c
+++ b/liblwgeom/stringbuffer.c
@@ -191,7 +191,9 @@ stringbuffer_avprintf(stringbuffer_t *s, const char *fmt, va_list ap)
 	/* Propogate errors up */
 	if ( len < 0 )
 		#if defined(__MINGW64_VERSION_MAJOR)
+		va_copy(ap2, ap);
 		len = _vscprintf(fmt, ap2);/**Assume windows flaky vsnprintf that returns -1 if initial buffer to small and add more space **/
+		va_end(ap2);
 		#else
 		return len;
 		#endif

commit 6650f487b0c30fc1ae1ab816574b650b4882971e
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sun Apr 11 15:43:45 2021 +0200

    Add missing va_end() calls

diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index 647de60..1ab3fc0 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -104,6 +104,7 @@ static void geos_destroy(size_t count, ...) {
 			GEOSGeom_destroy(g);
 		}
 	}
+	va_end(ap);
 }
 
 /*
@@ -631,6 +632,7 @@ get_result_srid(size_t count, const char* funcname, ...)
 		if (!g)
 		{
 			lwerror("%s: Geometry is null", funcname);
+			va_end(ap);
 			return SRID_INVALID;
 		}
 		if (i == 0)
@@ -642,10 +644,12 @@ get_result_srid(size_t count, const char* funcname, ...)
 			if (g->srid != srid)
 			{
 				lwerror("%s: Operation on mixed SRID geometries (%d != %d)", funcname, srid, g->srid);
+				va_end(ap);
 				return SRID_INVALID;
 			}
 		}
 	}
+	va_end(ap);
 	return srid;
 }
 

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

Summary of changes:
 liblwgeom/lwgeom_geos.c  | 4 ++++
 liblwgeom/lwgeom_topo.c  | 3 ++-
 liblwgeom/stringbuffer.c | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list