summaryrefslogtreecommitdiffstats
path: root/sys/dev/syscons/scmouse.c
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2005-08-30 18:58:17 +0000
committerrodrigc <rodrigc@FreeBSD.org>2005-08-30 18:58:17 +0000
commit202872e9e687e8cc11a6302ad1aa8d0781556ccd (patch)
tree7796a5bca15fb24807fcf1b8d8fa3f0b68805a4b /sys/dev/syscons/scmouse.c
parent40d25976f11fbf40e8b37a57763c0e2a223bc034 (diff)
downloadFreeBSD-src-202872e9e687e8cc11a6302ad1aa8d0781556ccd.zip
FreeBSD-src-202872e9e687e8cc11a6302ad1aa8d0781556ccd.tar.gz
Prevent division by zero errors in sc_mouse_move()
by explicitly setting sc->font_width, in the same places where sc->font_size is set, instead of relying on the default initialized value of 0 for sc->font_width. PR: kern/84836 Reported by: Andrey V. Elsukov <bu7cher at yandex dot ru> MFC after: 2 days
Diffstat (limited to 'sys/dev/syscons/scmouse.c')
-rw-r--r--sys/dev/syscons/scmouse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/syscons/scmouse.c b/sys/dev/syscons/scmouse.c
index bec8f74..794a4ba 100644
--- a/sys/dev/syscons/scmouse.c
+++ b/sys/dev/syscons/scmouse.c
@@ -126,7 +126,7 @@ sc_mouse_move(scr_stat *scp, int x, int y)
s = spltty();
scp->mouse_xpos = scp->mouse_oldxpos = x;
scp->mouse_ypos = scp->mouse_oldypos = y;
- if (scp->font_size <= 0)
+ if (scp->font_size <= 0 || scp->font_width <= 0)
scp->mouse_pos = scp->mouse_oldpos = 0;
else
scp->mouse_pos = scp->mouse_oldpos =
OpenPOWER on IntegriCloud