summaryrefslogtreecommitdiffstats
path: root/usr.bin/sockstat/sockstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/sockstat/sockstat.c')
-rw-r--r--usr.bin/sockstat/sockstat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index b68906e..eaeb242 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -540,8 +540,12 @@ display(void)
break;
}
/* client */
- pos += xprintf("-> ");
p = *(void **)&s->faddr;
+ if (p == NULL) {
+ pos += xprintf("(not connected)");
+ break;
+ }
+ pos += xprintf("-> ");
for (hash = 0; hash < HASHSIZE; ++hash) {
for (s = sockhash[hash]; s != NULL; s = s->next)
if (s->pcb == p)
OpenPOWER on IntegriCloud