mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 13:04:35 +03:00
Ensure DynamicColumn hash lookups never see NULL pointers
This cannot happen in these code locations, but for the purposes of static checkers like Coverity scan (and for future proofing), add two more guards on NULL hash table entry pointers.
This commit is contained in:
5
Action.c
5
Action.c
@ -174,8 +174,9 @@ static Htop_Reaction actionSetSortColumn(State* st) {
|
||||
char* name = NULL;
|
||||
if (fields[i] >= LAST_PROCESSFIELD) {
|
||||
DynamicColumn* column = Hashtable_get(dynamicColumns, fields[i]);
|
||||
if (column)
|
||||
name = xStrdup(column->caption ? column->caption : column->name);
|
||||
if (column == NULL)
|
||||
continue;
|
||||
name = xStrdup(column->caption ? column->caption : column->name);
|
||||
} else {
|
||||
name = String_trim(Process_fields[fields[i]].name);
|
||||
}
|
||||
|
Reference in New Issue
Block a user