[postgis-commits] svn - r3376 - trunk/liblwgeom
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Thu Dec 11 06:55:22 PST 2008
Author: mcayland
Date: 2008-12-11 06:55:21 -0800 (Thu, 11 Dec 2008)
New Revision: 3376
Modified:
trunk/liblwgeom/lwutil.c
Log:
Increase the amount of allocated memory by 3 bytes, so that if maxlength < 3 and we return just "..." then we still have enough space to store the string without clobbering memory.
Modified: trunk/liblwgeom/lwutil.c
===================================================================
--- trunk/liblwgeom/lwutil.c 2008-12-11 13:46:29 UTC (rev 3375)
+++ trunk/liblwgeom/lwutil.c 2008-12-11 14:55:21 UTC (rev 3376)
@@ -290,7 +290,7 @@
char *outstart;
/* Allocate space for new string */
- output = lwalloc(maxlength + 1);
+ output = lwalloc(maxlength + 4);
output[0] = '\0';
/* Start truncation */
More information about the postgis-commits
mailing list