Skip to content

Commit 0854727

Browse files
firetechnhongooi
authored andcommitted
Fix two out of bounds accesses from qmk#13330. (qmk#13525)
Two occurrences of `MATRIX_ROWS` weren't properly changed to `ROWS_PER_HAND` in qmk#13330, causing a crash during boot on at least my Ergodox Infinity (including qmk#13481).
1 parent f1385e0 commit 0854727

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

quantum/matrix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static void unselect_row(uint8_t row) {
149149
}
150150

151151
static void unselect_rows(void) {
152-
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
152+
for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
153153
unselect_row(x);
154154
}
155155
}
@@ -214,7 +214,7 @@ static void unselect_cols(void) {
214214

215215
__attribute__((weak)) void matrix_init_pins(void) {
216216
unselect_cols();
217-
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
217+
for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
218218
if (row_pins[x] != NO_PIN) {
219219
setPinInputHigh_atomic(row_pins[x]);
220220
}

0 commit comments

Comments
 (0)