[postgis-tickets] r17720 - Avoid reading into empty pointarray

Paul Ramsey pramsey at cleverelephant.ca
Fri Aug 16 01:58:44 PDT 2019


Author: pramsey
Date: 2019-08-16 13:58:44 -0700 (Fri, 16 Aug 2019)
New Revision: 17720

Modified:
   branches/2.4/liblwgeom/g_serialized.c
Log:
Avoid reading into empty pointarray
References #4475


Modified: branches/2.4/liblwgeom/g_serialized.c
===================================================================
--- branches/2.4/liblwgeom/g_serialized.c	2019-08-15 19:43:53 UTC (rev 17719)
+++ branches/2.4/liblwgeom/g_serialized.c	2019-08-16 20:58:44 UTC (rev 17720)
@@ -950,7 +950,8 @@
 			lwerror("Dimensions mismatch in lwpoly");
 
 		pasize = pa->npoints * ptsize;
-		memcpy(loc, getPoint_internal(pa, 0), pasize);
+		if ( pasize )
+			memcpy(loc, getPoint_internal(pa, 0), pasize);
 		loc += pasize;
 	}
 	return (size_t)(loc - buf);



More information about the postgis-tickets mailing list