summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-02-05 10:59:20 +0100
committerHisham Muhammad <hisham@gobolinux.org>2018-02-05 10:59:20 +0100
commit03f17688ada3800bdd344ec4397f81289977b153 (patch)
tree616a98f168f392a5937a80317afd089b057a7206
parenta32d7528f62ea5a61a3d35fe3056f62153fd27c3 (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.
-rw-r--r--Panel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Panel.c b/Panel.c
index 8c4d44fc..1e53b4a4 100644
--- a/Panel.c
+++ b/Panel.c
@@ -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;

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