diff options
author | Anton Lindqvist <anton@cvs.openbsd.org> | 2022-08-11 09:22:39 +0000 |
---|---|---|
committer | Anton Lindqvist <anton@cvs.openbsd.org> | 2022-08-11 09:22:39 +0000 |
commit | 2e3975d668046a0d742ad1d05f802db94d5e801b (patch) | |
tree | db43b2cc20918711b1aba5616cd329b6172b76e5 /sys | |
parent | 9ec82828391c17231ef1e3ecc3ddf7037acf0829 (diff) |
Revert previous commit as the bounds check was correct.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/ucc.c | 4 |
1 files 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 <anton@openbsd.org> @@ -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; |