Description: Fix segfault in xymongen/wmlgen.c
Origin: http://lists.xymon.com/pipermail/xymon/2015-October/042367.html
Author: J.C. Cleaver <cleaver@terabithia.org>
Reviewed-By: Axel Beckert <abe@debian.org>

Index: xymon/xymongen/wmlgen.c
===================================================================
--- xymon.orig/xymongen/wmlgen.c	2015-09-11 12:24:31.416215543 +0200
+++ xymon/xymongen/wmlgen.c	2015-10-05 11:09:23.959811370 +0200
@@ -117,6 +117,7 @@
 	}
 
 	nextline = msg;
+	l[MAX_LINE_LEN - 1] = '\0';
 
 	sprintf(fn, "%s/%s.%s.wml", wmldir, host->hostname, entry->column->name);
 	fd = fopen(fn, "w");
@@ -147,7 +148,7 @@
 	 */
 	while (nextline) {
 		p = strchr(nextline, '\n'); if (p) *p = '\0';
-		strcpy(l, nextline);
+		strncpy(l, nextline, (MAX_LINE_LEN - 1));
 		if (p) nextline = p+1; else nextline = NULL;
 
 		outp = lineout;
