Fix NULL dereference in "-S name" when syscall table has holes
* count.c (syscall_cmp): Do not pass NULL to strcmp.
This commit is contained in:
parent
804bb8797b
commit
fa925dce70
5
count.c
5
count.c
@ -112,8 +112,9 @@ time_cmp(void *a, void *b)
|
|||||||
static int
|
static int
|
||||||
syscall_cmp(void *a, void *b)
|
syscall_cmp(void *a, void *b)
|
||||||
{
|
{
|
||||||
return strcmp(sysent[*((int *) a)].sys_name,
|
const char *a_name = sysent[*((int *) a)].sys_name;
|
||||||
sysent[*((int *) b)].sys_name);
|
const char *b_name = sysent[*((int *) b)].sys_name;
|
||||||
|
return strcmp(a_name ? a_name : "", b_name ? b_name : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user