summaryrefslogtreecommitdiffstats
path: root/MainPanel.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2016-01-03 16:31:44 -0200
committerHisham Muhammad <hisham@gobolinux.org>2016-01-03 16:31:44 -0200
commit70cd5c2b88ca6b2f9966a5e9b3e8be19a938b7f7 (patch)
tree737a5ff78ec0b16b3d7e82277ab74eae73f8d40a /MainPanel.c
parentc8cadfb90515102daff5ac98c02f15a6ac07d112 (diff)
Check range when accessing keys table.
Should fix #321.
Diffstat (limited to 'MainPanel.c')
-rw-r--r--MainPanel.c2
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)) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy