From owner-svn-src-all@FreeBSD.ORG Sun Dec 5 10:15:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80B771065673; Sun, 5 Dec 2010 10:15:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4C28FC0C; Sun, 5 Dec 2010 10:15:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB5AFNFO082883; Sun, 5 Dec 2010 10:15:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB5AFNEQ082881; Sun, 5 Dec 2010 10:15:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201012051015.oB5AFNEQ082881@svn.freebsd.org> From: Ed Schouten Date: Sun, 5 Dec 2010 10:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216198 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 05 Dec 2010 10:15:23 -0000 Author: ed Date: Sun Dec 5 10:15:23 2010 New Revision: 216198 URL: http://svn.freebsd.org/changeset/base/216198 Log: Use proper bounds checking on VPA. We must check against tp->t_cursor.tp_row, not row, to figure out whether we must clamp the cursor position. Submitted by: luigi MFC after: 3 weeks Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun Dec 5 09:35:07 2010 (r216197) +++ head/sys/teken/teken_subr.h Sun Dec 5 10:15:23 2010 (r216198) @@ -1299,10 +1299,9 @@ teken_subr_vertical_position_absolute(te { t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1; - if (row >= t->t_originreg.ts_end) + if (t->t_cursor.tp_row >= t->t_originreg.ts_end) t->t_cursor.tp_row = t->t_originreg.ts_end - 1; - t->t_stateflags &= ~TS_WRAPPED; teken_funcs_cursor(t); }