[SCM] PostGIS branch master updated. 3.5.0-390-gc93260451
git at osgeo.org
git at osgeo.org
Wed Jun 11 07:09:38 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, master has been updated
via c932604514651d454543b66fdb18055fd5ae40a2 (commit)
from 897574430c06d22d682ef6f13a4f727a9326e52d (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 c932604514651d454543b66fdb18055fd5ae40a2
Author: Maksim Korotkov <m.korotkov at postgrespro.ru>
Date: Tue Jun 10 09:56:48 2025 +0300
liblwgeom: avoid NULL pointer dereference
Signed-off-by: Maksim Korotkov <m.korotkov at postgrespro.ru>
diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c
index c75bbb6ca..8d5a0f0e1 100644
--- a/liblwgeom/lwgeom_api.c
+++ b/liblwgeom/lwgeom_api.c
@@ -443,7 +443,11 @@ void printPA(POINTARRAY *pa)
POINT4D pt;
char *mflag;
-
+ if (!pa)
+ {
+ lwnotice(" PTARRAY is null pointer!");
+ return;
+ }
if ( FLAGS_GET_M(pa->flags) ) mflag = "M";
else mflag = "";
@@ -452,24 +456,17 @@ void printPA(POINTARRAY *pa)
FLAGS_NDIMS(pa->flags), ptarray_point_size(pa));
lwnotice(" npoints = %u", pa->npoints);
- if (!pa)
+ for (t = 0; t < pa->npoints; t++)
{
- lwnotice(" PTARRAY is null pointer!");
+ getPoint4d_p(pa, t, &pt);
+ if (FLAGS_NDIMS(pa->flags) == 2)
+ lwnotice(" %i : %lf,%lf", t, pt.x, pt.y);
+ if (FLAGS_NDIMS(pa->flags) == 3)
+ lwnotice(" %i : %lf,%lf,%lf", t, pt.x, pt.y, pt.z);
+ if (FLAGS_NDIMS(pa->flags) == 4)
+ lwnotice(" %i : %lf,%lf,%lf,%lf", t, pt.x, pt.y, pt.z, pt.m);
}
- else
- {
- for (t = 0; t < pa->npoints; t++)
- {
- getPoint4d_p(pa, t, &pt);
- if (FLAGS_NDIMS(pa->flags) == 2)
- lwnotice(" %i : %lf,%lf", t, pt.x, pt.y);
- if (FLAGS_NDIMS(pa->flags) == 3)
- lwnotice(" %i : %lf,%lf,%lf", t, pt.x, pt.y, pt.z);
- if (FLAGS_NDIMS(pa->flags) == 4)
- lwnotice(" %i : %lf,%lf,%lf,%lf", t, pt.x, pt.y, pt.z, pt.m);
- }
- }
lwnotice(" }");
}
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/lwgeom_api.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list