Sfoglia il codice sorgente

Null terminate string which resulted in failure of confdb during logging.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1687 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 17 anni fa
parent
commit
418739f8f0
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      exec/logsys.c

+ 1 - 0
exec/logsys.c

@@ -232,6 +232,7 @@ static inline int strcpy_cutoff (char *dest, char *src, int cutoff)
 	} else {
 		assert (cutoff > 0);
 		strncpy (dest, src, cutoff);
+		dest[cutoff] = '\0';
 		len = strlen (dest);
 		if (len != cutoff) {
 			memset (&dest[len], ' ', cutoff - len);