From owner-svn-src-all@FreeBSD.ORG Thu May 29 21:10:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFDCFA5; Thu, 29 May 2014 21:10:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D25D27E8; Thu, 29 May 2014 21:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TLAXNQ020409; Thu, 29 May 2014 21:10:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TLAXFU020408; Thu, 29 May 2014 21:10:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405292110.s4TLAXFU020408@svn.freebsd.org> From: Ed Maste Date: Thu, 29 May 2014 21:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266861 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 21:10:33 -0000 Author: emaste Date: Thu May 29 21:10:33 2014 New Revision: 266861 URL: http://svnweb.freebsd.org/changeset/base/266861 Log: Update size in vt_grow if we don't have to reallocate vt_grow may be called with a new size that's larger than previous but does not require reallocation - for example, when the number of columns is the same and new number of rows is less than the history size. Prior to this change we would fail to update vb_scr_size, and then hit a KASSERT when trying to write to the newly visible rows. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_buf.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Thu May 29 21:03:49 2014 (r266860) +++ head/sys/dev/vt/vt_buf.c Thu May 29 21:10:33 2014 (r266861) @@ -496,6 +496,9 @@ vtbuf_grow(struct vt_buf *vb, const term /* Deallocate old buffer. */ free(old, M_VTBUF); free(oldrows, M_VTBUF); + } else { + /* Just update the size. */ + vb->vb_scr_size = *p; } }