Skip to content

Commit

Permalink
Fix two out of bounds accesses from qmk#13330.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
firetech committed Jul 12, 2021
1 parent 89980ff commit eb01fe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quantum/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void unselect_row(uint8_t row) {
}

static void unselect_rows(void) {
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
unselect_row(x);
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ static void unselect_cols(void) {

__attribute__((weak)) void matrix_init_pins(void) {
unselect_cols();
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
if (row_pins[x] != NO_PIN) {
setPinInputHigh_atomic(row_pins[x]);
}
Expand Down

0 comments on commit eb01fe5

Please sign in to comment.