diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-05 10:59:20 +0100 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-05 10:59:20 +0100 |
commit | 03f17688ada3800bdd344ec4397f81289977b153 (patch) | |
tree | 616a98f168f392a5937a80317afd089b057a7206 /Panel.c | |
parent | a32d7528f62ea5a61a3d35fe3056f62153fd27c3 (diff) |
Handle unexpected values for character passed to isalnum
It seems that certain negative integer values can crash isalnum().
Let's protect against those.
Fixes #711.
Diffstat (limited to 'Panel.c')
-rw-r--r-- | Panel.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -469,7 +469,7 @@ HandlerResult Panel_selectByTyping(Panel* this, int ch) { this->eventHandlerState = xCalloc(100, sizeof(char)); char* buffer = this->eventHandlerState; - if (ch < 255 && isalnum(ch)) { + if (ch > 0 && ch < 255 && isalnum(ch)) { int len = strlen(buffer); if (len < 99) { buffer[len] = ch; |