svn commit: r334979 - head/sbin/dump

Warner Losh imp at FreeBSD.org
Mon Jun 11 20:38:27 UTC 2018


Author: imp
Date: Mon Jun 11 20:38:26 2018
New Revision: 334979
URL: https://svnweb.freebsd.org/changeset/base/334979

Log:
  Fix a bug in the counting of blks.
  
  We shouldn't count the bytes set in c_addr for TS_CLRI and TS_BITS
  nodes. Those block overload c_count to communicate how many blocks
  follow, not now many c_addr spaces are used. Dump would dump core
  (now) because memory layout moved around and we'd access elements past
  the end to make a count.
  
  Reviewed by: kib@

Modified:
  head/sbin/dump/tape.c

Modified: head/sbin/dump/tape.c
==============================================================================
--- head/sbin/dump/tape.c	Mon Jun 11 20:26:10 2018	(r334978)
+++ head/sbin/dump/tape.c	Mon Jun 11 20:38:26 2018	(r334979)
@@ -279,7 +279,8 @@ flushtape(void)
 	}
 
 	blks = 0;
-	if (spcl.c_type != TS_END) {
+	if (spcl.c_type != TS_END && spcl.c_type != TS_CLRI &&
+	    spcl.c_type != TS_BITS) {
 		assert(spcl.c_count <= TP_NINDIR);
 		for (i = 0; i < spcl.c_count; i++)
 			if (spcl.c_addr[i] != 0)


More information about the svn-src-head mailing list