diff options
author | marcel <marcel@FreeBSD.org> | 2003-10-27 06:50:57 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-10-27 06:50:57 +0000 |
commit | d270e076a6cf5068e069f059428ebc01d811ae13 (patch) | |
tree | 7e2c75ebf6b86071b054158f6598284ecfd95779 | |
parent | 729434c9829cefacc53b5aac8cb09c176317d41c (diff) | |
download | FreeBSD-src-d270e076a6cf5068e069f059428ebc01d811ae13.zip FreeBSD-src-d270e076a6cf5068e069f059428ebc01d811ae13.tar.gz |
Fix truss so that it doesn't abort/exit when a syscall has been given
a NULL-pointer for a sockaddr argument.
-rw-r--r-- | usr.bin/truss/syscalls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index d020d61..1b7318e 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -365,6 +365,11 @@ print_arg(int fd, struct syscall_args *sc, unsigned long *args) { u_char *q; int i; + if (args[sc->offset] == 0) { + asprintf(&tmp, "NULL"); + break; + } + /* yuck: get ss_len */ if (get_struct(fd, (void *)args[sc->offset], (void *)&ss, sizeof(ss.ss_len) + sizeof(ss.ss_family)) == -1) |