[postgis-tickets] r17721 - Avoid reading into empty ptarray

Paul Ramsey pramsey at cleverelephant.ca
Fri Aug 16 01:59:43 PDT 2019


Author: pramsey
Date: 2019-08-16 13:59:43 -0700 (Fri, 16 Aug 2019)
New Revision: 17721

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


Modified: branches/2.3/liblwgeom/g_serialized.c
===================================================================
--- branches/2.3/liblwgeom/g_serialized.c	2019-08-16 20:58:44 UTC (rev 17720)
+++ branches/2.3/liblwgeom/g_serialized.c	2019-08-16 20:59:43 UTC (rev 17721)
@@ -706,7 +706,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