summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-10-27 06:50:57 +0000
committermarcel <marcel@FreeBSD.org>2003-10-27 06:50:57 +0000
commitd270e076a6cf5068e069f059428ebc01d811ae13 (patch)
tree7e2c75ebf6b86071b054158f6598284ecfd95779 /usr.bin/truss
parent729434c9829cefacc53b5aac8cb09c176317d41c (diff)
downloadFreeBSD-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.
Diffstat (limited to 'usr.bin/truss')
-rw-r--r--usr.bin/truss/syscalls.c5
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)
OpenPOWER on IntegriCloud