From dc47bf5f7a0bd2a9b4b82a62c101483245d6c605 Mon Sep 17 00:00:00 2001 From: anton Date: Thu, 11 Aug 2022 09:22:38 +0000 Subject: [PATCH] Revert previous commit as the bounds check was correct. --- sys/dev/usb/ucc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/ucc.c b/sys/dev/usb/ucc.c index 7f08db1a0db..4dff13034c1 100644 --- a/sys/dev/usb/ucc.c +++ b/sys/dev/usb/ucc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucc.c,v 1.34 2022/08/05 16:59:50 miod Exp $ */ +/* $OpenBSD: ucc.c,v 1.35 2022/08/11 09:22:38 anton Exp $ */ /* * Copyright (c) 2021 Anton Lindqvist @@ -1013,7 +1013,7 @@ ucc_add_key(struct ucc_softc *sc, int32_t usage, u_int bit) if (ucc_usage_to_sym(usage, &us)) return 0; - if (sc->sc_maplen + 2 >= sc->sc_mapsiz) + if (sc->sc_maplen + 2 > sc->sc_mapsiz) return ENOMEM; sc->sc_map[sc->sc_maplen++] = KS_KEYCODE(sc->sc_isarray ? usage : bit); sc->sc_map[sc->sc_maplen++] = us->us_key; -- 2.20.1