From 7c2ef830b313c62e1dbf1b0af40ef876cbb9ab29 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Wed, 2 Dec 2026 18:32:51 -0300 Subject: [PATCH] Fix out-of-bounds row in Keychron RGB LED index query rgb_get_led_idx accepted row == MATRIX_ROWS and read one row past the end of g_led_config.matrix_co, returning bytes of g_led_config.point as LED indices. Hosts that scan rows until the firmware rejects one, such as OpenRGB, then place an unrelated LED in a row that does not exist. --- keyboards/keychron/common/rgb/keychron_rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/common/rgb/keychron_rgb.c b/keyboards/keychron/common/rgb/keychron_rgb.c index 987adb8ab312..43e48f80376c 100644 --- a/keyboards/keychron/common/rgb/keychron_rgb.c +++ b/keyboards/keychron/common/rgb/keychron_rgb.c @@ -144,7 +144,7 @@ static bool rgb_get_led_count(uint8_t *data) { static bool rgb_get_led_idx(uint8_t *data) { uint8_t row = data[0]; - if (row > MATRIX_ROWS) return false; + if (row >= MATRIX_ROWS) return false; uint8_t led_idx[128]; uint32_t row_mask = 0;