diff --git a/usr.bin/truss/amd64-fbsd32.c b/usr.bin/truss/amd64-fbsd32.c index dac6aa1269cf..45da1cdf3dd4 100644 --- a/usr.bin/truss/amd64-fbsd32.c +++ b/usr.bin/truss/amd64-fbsd32.c @@ -236,7 +236,8 @@ i386_syscall_entry(struct trussinfo *trussinfo, int nargs) { * parameter? */ - if (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit")) { + if (fsc.name != NULL && + (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { /* XXX * This could be done in a more general diff --git a/usr.bin/truss/i386-fbsd.c b/usr.bin/truss/i386-fbsd.c index dac6aa1269cf..45da1cdf3dd4 100644 --- a/usr.bin/truss/i386-fbsd.c +++ b/usr.bin/truss/i386-fbsd.c @@ -236,7 +236,8 @@ i386_syscall_entry(struct trussinfo *trussinfo, int nargs) { * parameter? */ - if (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit")) { + if (fsc.name != NULL && + (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { /* XXX * This could be done in a more general diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 42c2fa6f764e..6bae74ef03d8 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -165,6 +165,8 @@ struct syscall * get_syscall(const char *name) { struct syscall *sc = syscalls; + if (name == NULL) + return (NULL); while (sc->name) { if (!strcmp(name, sc->name)) return sc;