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:
Joachim Nilsson 2015-02-01 15:03:19 +01:00
parent 528581cb48
commit c497555bec

View File

@ -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;
}