summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-01-12 17:14:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-01-12 17:14:49 +0000
commitf70f71a04a7cdf9b9c342b4ce388e7c4ef515320 (patch)
tree7ae8feef1c3ed4cd3a350001dabf0dc23d3d05e6 /sys/arch/sparc64
parent59af4b629319b54f91c14e7457f168b56c748513 (diff)
Be more strict when checking window-left and window-top values.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/fb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/arch/sparc64/dev/fb.c b/sys/arch/sparc64/dev/fb.c
index cc06c72ac85..6872fcbc182 100644
--- a/sys/arch/sparc64/dev/fb.c
+++ b/sys/arch/sparc64/dev/fb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fb.c,v 1.19 2009/01/11 15:27:32 miod Exp $ */
+/* $OpenBSD: fb.c,v 1.20 2009/01/12 17:14:48 miod Exp $ */
/* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */
/*
@@ -220,9 +220,17 @@ fbwscons_init(struct sunfb *sf, int flags, int isconsole)
* 80x34 console window.
*/
fw = 12; fh = 22;
- wt = 0; wl = 0;
+ wt = wl = 0;
+ } else {
+ /*
+ * Make sure window-top and window-left
+ * values are consistent with the font metrics.
+ */
+ if (wt <= 0 || wt > sf->sf_width - cols * fw ||
+ wl <= 0 || wl > sf->sf_height - rows * fh)
+ wt = wl = 0;
}
- if (wt == 0 || wl == 0) {
+ if (wt == 0 /* || wl == 0 */) {
ri->ri_flg |= RI_CENTER;
/*