[postgis-tickets] r14938 - Resolve scan-build strncat warning

Daniel Baston dbaston at gmail.com
Tue Jun 7 05:57:22 PDT 2016


Author: dbaston
Date: 2016-06-07 05:57:22 -0700 (Tue, 07 Jun 2016)
New Revision: 14938

Modified:
   trunk/postgis/lwgeom_ogc.c
Log:
Resolve scan-build strncat warning

Modified: trunk/postgis/lwgeom_ogc.c
===================================================================
--- trunk/postgis/lwgeom_ogc.c	2016-06-07 05:43:14 UTC (rev 14937)
+++ trunk/postgis/lwgeom_ogc.c	2016-06-07 12:57:22 UTC (rev 14938)
@@ -177,8 +177,8 @@
 {
 	GSERIALIZED *gser;
 	text *type_text;
-	static int type_str_len = 32;
-	char type_str[type_str_len];
+	static int type_str_len = 31;
+	char type_str[type_str_len + 1];
 
 	/* Read just the header from the toasted tuple */
 	gser = PG_GETARG_GSERIALIZED_P_SLICE(0, 0, gserialized_max_header_size());



More information about the postgis-tickets mailing list