diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2024-08-16 12:22:18 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2024-08-16 12:22:18 +0000 |
commit | ee06a13ff5284de8651b6956f198b1ad732df3b3 (patch) | |
tree | 0e1d1df23857936ae006349d63b0fccc4aabe992 /sys/dev/wscons | |
parent | cbfe76a7f9841461d3e4cad4442ab9a575198076 (diff) |
Fix bounds checking in wsmux_getmux().
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r-- | sys/dev/wscons/wsmux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c index f483453291f..3176c6e6f2f 100644 --- a/sys/dev/wscons/wsmux.c +++ b/sys/dev/wscons/wsmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmux.c,v 1.58 2024/05/29 06:39:13 jsg Exp $ */ +/* $OpenBSD: wsmux.c,v 1.59 2024/08/16 12:22:17 miod Exp $ */ /* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */ /* @@ -143,7 +143,7 @@ wsmux_getmux(int n) struct wsmux_softc **new, **old; int i; - if (n >= WSMUX_MAXDEV) + if (n < 0 || n >= WSMUX_MAXDEV) return (NULL); /* Make sure there is room for mux n in the table */ |