mirror of
https://github.com/troglobit/editline.git
synced 2025-05-05 20:11:12 +08:00
editline.c:find_key_in_map() -- Add check to prevent out of bounds access.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
528581cb48
commit
c497555bec
@ -1683,7 +1683,7 @@ static size_t find_key_in_map(int key, el_keymap_t map[], size_t mapsz)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; map[i].Function; i++) {
|
||||
for (i = 0; map[i].Function && i < mapsz; i++) {
|
||||
if (map[i].Key == key)
|
||||
return i;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user