mirror of
https://github.com/troglobit/editline.git
synced 2025-09-14 23:28:09 +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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user