mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-21 23:03:11 +01:00
Fix potential out of bounds access
The preferred pos mechanism could cause an out of bounds access on 1 row layouts.
This commit is contained in:
parent
e74b45c2d6
commit
0549c6c8a1
@ -82,7 +82,7 @@ public final class KeyboardData
|
||||
boolean add_key_to_pos(List<Row> rows, KeyValue kv, KeyPos p)
|
||||
{
|
||||
int i_row = p.row;
|
||||
int i_row_end = p.row;
|
||||
int i_row_end = Math.min(p.row, rows.size());
|
||||
if (p.row == -1) { i_row = 0; i_row_end = rows.size() - 1; }
|
||||
for (; i_row <= i_row_end; i_row++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user