Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Nov 2015 18:45:35 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291217 - head/sys/kern
Message-ID:  <201511231845.tANIjZfx075766@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Nov 23 18:45:35 2015
New Revision: 291217
URL: https://svnweb.freebsd.org/changeset/base/291217

Log:
  The buffer passed to an sbuf drain callback is not necessarily
  null-terminated, so don't assume that it is.
  
  Reported by:	pho
  X-MFC-With:	r291059

Modified:
  head/sys/kern/subr_witness.c

Modified: head/sys/kern/subr_witness.c
==============================================================================
--- head/sys/kern/subr_witness.c	Mon Nov 23 18:20:32 2015	(r291216)
+++ head/sys/kern/subr_witness.c	Mon Nov 23 18:45:35 2015	(r291217)
@@ -2987,7 +2987,7 @@ static int
 witness_output_drain(void *arg __unused, const char *data, int len)
 {
 
-	witness_output("%s", data);
+	witness_output("%.*s", len, data);
 	return (len);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511231845.tANIjZfx075766>