summaryrefslogtreecommitdiff
path: root/sys/dev/ic/vga.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-12-02 19:11:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-12-02 19:11:12 +0000
commit1659880111098d72d04a0bd82814b15331574f01 (patch)
tree33321d9e2271bd340658bf15ab375a5298ecdad4 /sys/dev/ic/vga.c
parent7dca3c983e2fdf6a7926086522bf397531f6a2f6 (diff)
In alloc_attr(), make sure xxansitopc[] indicies are within bounds.
Diffstat (limited to 'sys/dev/ic/vga.c')
-rw-r--r--sys/dev/ic/vga.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index a1560921ecc..a80b3392163 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga.c,v 1.42 2006/11/29 19:11:15 miod Exp $ */
+/* $OpenBSD: vga.c,v 1.43 2006/12/02 19:11:09 miod Exp $ */
/* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */
/*
@@ -984,10 +984,10 @@ vga_alloc_attr(id, fg, bg, flags, attrp)
if (flags & (WSATTR_UNDERLINE | WSATTR_REVERSE))
return (EINVAL);
if (flags & WSATTR_WSCOLORS)
- *attrp = fgansitopc[fg] | bgansitopc[bg];
+ *attrp = fgansitopc[fg & 7] | bgansitopc[bg & 7];
else
*attrp = 7;
- if (flags & WSATTR_HILIT)
+ if ((flags & WSATTR_HILIT) || (fg & 8) || (bg & 8))
*attrp += 8;
}
if (flags & WSATTR_BLINK)