blob: c74cab7fefb3df5efce3831ec32cf0343e758d39 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Description: Handle unexpected values for character passed to isalnum
Bug: https://github.com/hishamhm/htop/issues/711
Origin: upstream,https://github.com/hishamhm/htop/commit/03f17688ada3800bdd344ec4397f81289977b153
Author: Hisham Muhammad <hisham@gobolinux.org>
Last-Update: 2018-02-05
--- 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;
|