From 9d955309275406370fe18e6459c97a2934e05278 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 9 Sep 2019 18:29:02 +0200 Subject: [PATCH] hardware/Model01: Fix a possible out of bounds error in getCrgbAt() Fixes #660. Signed-off-by: Gergely Nagy --- src/kaleidoscope/hardware/keyboardio/Model01.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kaleidoscope/hardware/keyboardio/Model01.cpp b/src/kaleidoscope/hardware/keyboardio/Model01.cpp index 68bc970d..23ef0c00 100644 --- a/src/kaleidoscope/hardware/keyboardio/Model01.cpp +++ b/src/kaleidoscope/hardware/keyboardio/Model01.cpp @@ -121,7 +121,7 @@ int8_t Model01::getLedIndex(KeyAddr key_addr) { } cRGB Model01::getCrgbAt(int8_t i) { - if (i < 0 || i > 64) + if (i < 0 || i >= 64) return {0, 0, 0}; if (i < 32) {