Fix truss so that it doesn't abort/exit when a syscall has been given

a NULL-pointer for a sockaddr argument.
This commit is contained in:
Marcel Moolenaar 2003-10-27 06:50:57 +00:00
parent 3f741ca117
commit a7a08c7e63

View File

@ -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)