Obey sv_syscallnames bounds in syscallname().
Reported and tested by: pho
This commit is contained in:
parent
5758b8c344
commit
4de7ec3dbb
@ -245,10 +245,12 @@ const char *
|
||||
syscallname(struct proc *p, u_int code)
|
||||
{
|
||||
static const char unknown[] = "unknown";
|
||||
struct sysentvec *sv;
|
||||
|
||||
if (p->p_sysent->sv_syscallnames == NULL)
|
||||
sv = p->p_sysent;
|
||||
if (sv->sv_syscallnames == NULL || code >= sv->sv_size)
|
||||
return (unknown);
|
||||
return (p->p_sysent->sv_syscallnames[code]);
|
||||
return (sv->sv_syscallnames[code]);
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user