Check if name is NULL before we strcmp the syscall name. This was

sometimes triggered if you began trussing a process while it was
in a syscall, as the name is filled in when the syscall is made.
This commit is contained in:
David Malone 2002-11-09 22:28:38 +00:00
parent 40276eb1ea
commit 967706f308
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106712

View file

@ -412,7 +412,7 @@ print_syscall(struct trussinfo *trussinfo, const char *name, int nargs, char **s
if (trussinfo->flags & FOLLOWFORKS)
len += fprintf(trussinfo->outfile, "%5d: ", trussinfo->pid);
if (!strcmp(name, "execve") || !strcmp(name, "exit")) {
if (name != NULL && (!strcmp(name, "execve") || !strcmp(name, "exit"))) {
clock_gettime(CLOCK_REALTIME, &trussinfo->after);
}