From a362e7cd74816a784348eda2a7f62b7682e6ad24 Mon Sep 17 00:00:00 2001 From: miod Date: Fri, 16 Aug 2024 12:22:17 +0000 Subject: [PATCH] Fix bounds checking in wsmux_getmux(). --- sys/dev/wscons/wsmux.c | 4 ++-- 1 file 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 */ -- 2.20.1