diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2016-01-03 16:31:44 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2016-01-03 16:31:44 -0200 |
commit | 70cd5c2b88ca6b2f9966a5e9b3e8be19a938b7f7 (patch) | |
tree | 737a5ff78ec0b16b3d7e82277ab74eae73f8d40a | |
parent | c8cadfb90515102daff5ac98c02f15a6ac07d112 (diff) |
Check range when accessing keys table.
Should fix #321.
-rw-r--r-- | MainPanel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/MainPanel.c b/MainPanel.c index 2e91a3c5..336cfa46 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -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)) { |