From 46edc34b3dc769386ff74b79a8bb24b8cea4eaec Mon Sep 17 00:00:00 2001 From: alfred Date: Sun, 8 Aug 2004 23:29:36 +0000 Subject: [PATCH] don't seg if the syscall is invalid for i386fbsd. --- usr.bin/truss/amd64-fbsd32.c | 3 ++- usr.bin/truss/i386-fbsd.c | 3 ++- usr.bin/truss/syscalls.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) 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;