keyboard: Add bounds checking on keycode lookup
parent
20cd7725f6
commit
5731ea4666
|
@ -259,8 +259,10 @@ void keyboard_feed(struct keyboard* self, xkb_keysym_t symbol, bool is_pressed)
|
||||||
if (entry->level == level)
|
if (entry->level == level)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// TODO: Add out of bounds check
|
if (++entry >= &self->lookup_table[self->lookup_table_length])
|
||||||
if ((++entry)->symbol != symbol)
|
return; // TODO: Notify the user about this
|
||||||
|
|
||||||
|
if (entry->symbol != symbol)
|
||||||
return; // TODO: Notify the user about this
|
return; // TODO: Notify the user about this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue