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; result = HANDLED;
} else if (ch == 27) { } else if (ch == 27) {
return HANDLED; 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); reaction |= (this->keys[ch])(this->state);
result = HANDLED; result = HANDLED;
} else if (isdigit(ch)) { } else if (isdigit(ch)) {