[postgis-commits] svn - r3117 - trunk/lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Wed Oct 15 14:44:20 PDT 2008


Author: mcayland
Date: 2008-10-15 14:44:19 -0700 (Wed, 15 Oct 2008)
New Revision: 3117

Modified:
   trunk/lwgeom/lwgeom_pg.c
Log:
Fix pointer problem in the new HINT code caused by strncpy() not padding with zeros unless the specified length is *longer* than the source string.


Modified: trunk/lwgeom/lwgeom_pg.c
===================================================================
--- trunk/lwgeom/lwgeom_pg.c	2008-10-15 18:36:22 UTC (rev 3116)
+++ trunk/lwgeom/lwgeom_pg.c	2008-10-15 21:44:19 UTC (rev 3117)
@@ -44,7 +44,7 @@
 
 	/* If we are not at the start of the buffer, prefix with "..." */
 	if (hintstart != lwg_parser_result->wkinput)
-		strncpy(hintbuffer, "...", 3);
+		strncpy(hintbuffer, "...", 4);
 	
 	/* Append to the existing string */
 	strncat(hintbuffer, hintstart, hintfinish-hintstart);



More information about the postgis-commits mailing list