Check range when accessing keys table.

Should fix #321.
This commit is contained in:
Hisham Muhammad 2016-01-03 16:31:44 -02:00
parent c8cadfb905
commit 70cd5c2b88
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
result = HANDLED;
} else if (ch == 27) {
return HANDLED;
} else if (ch != ERR && this->keys[ch]) {
} else if (ch != ERR && ch > 0 && ch < KEY_MAX && this->keys[ch]) {
reaction |= (this->keys[ch])(this->state);
result = HANDLED;
} else if (isdigit(ch)) {