Date: Mon, 11 Jun 2018 20:38:26 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334979 - head/sbin/dump Message-ID: <201806112038.w5BKcQ7T077645@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806112038.w5BKcQ7T077645>