[SCM] PostGIS branch stable-3.5 updated. 3.5.3-35-ge3dfa56c1

git at osgeo.org git at osgeo.org
Tue Jul 22 01:38:23 PDT 2025


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.5 has been updated
       via  e3dfa56c1218b6fb1e738341a3032c717e165d0a (commit)
      from  7bf64acd2d6f60b3d364c96dfb6f404c79dd893e (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 e3dfa56c1218b6fb1e738341a3032c717e165d0a
Author: Sandro Santilli <strk at kbt.io>
Date:   Mon Jul 21 19:07:32 2025 +0200

    Do not pass a NULL pointer to lwrepalloc
    
    References #5947 in 3.5 branch (3.5.4dev)

diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index 3732ed9cc..f229d42de 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -230,9 +230,17 @@ ptarray_append_ptarray(POINTARRAY *pa1, POINTARRAY *pa2, double gap_tolerance)
 	ncap = pa1->npoints + npoints;
 	if ( pa1->maxpoints < ncap )
 	{
-		pa1->maxpoints = ncap > pa1->maxpoints*2 ?
-		                 ncap : pa1->maxpoints*2;
-		pa1->serialized_pointlist = lwrealloc(pa1->serialized_pointlist, (size_t)ptsize * pa1->maxpoints);
+		if ( pa1->maxpoints )
+		{
+			pa1->maxpoints = ncap > pa1->maxpoints*2 ?
+			                 ncap : pa1->maxpoints*2;
+			pa1->serialized_pointlist = lwrealloc(pa1->serialized_pointlist, (size_t)ptsize * pa1->maxpoints);
+		}
+		else
+		{
+			pa1->maxpoints = ncap;
+			pa1->serialized_pointlist = lwalloc((size_t)ptsize * pa1->maxpoints);
+		}
 	}
 
 	memcpy(getPoint_internal(pa1, pa1->npoints),

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

Summary of changes:
 liblwgeom/ptarray.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list