Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Aug 2014 16:56:34 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270587 - head/sys/dev/vt
Message-ID:  <201408251656.s7PGuYCM005931@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Mon Aug 25 16:56:33 2014
New Revision: 270587
URL: http://svnweb.freebsd.org/changeset/base/270587

Log:
  vt(4): Take font offset into account in vt_is_cursor_in_area()
  
  This fixes a "General protection fault" in vt_vga, where
  vt_is_cursor_in_area() erroneously reported that the cursor was over the
  text. This led to negative integers stored in "unsigned int" and chaos.
  
  MFC after:	1 week

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Mon Aug 25 16:25:18 2014	(r270586)
+++ head/sys/dev/vt/vt_core.c	Mon Aug 25 16:56:33 2014	(r270587)
@@ -828,8 +828,8 @@ vt_is_cursor_in_area(const struct vt_dev
 	 * We use the cursor position saved during the current refresh,
 	 * in case the cursor moved since.
 	 */
-	mx = vd->vd_mx_drawn;
-	my = vd->vd_my_drawn;
+	mx = vd->vd_mx_drawn + vd->vd_curwindow->vw_offset.tp_col;
+	my = vd->vd_my_drawn + vd->vd_curwindow->vw_offset.tp_row;
 
 	x1 = area->tr_begin.tp_col;
 	y1 = area->tr_begin.tp_row;



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