Commit 03f17688 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

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.
Showing with 1 addition and 1 deletion
+1 -1
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment