[Bug 256794] netstat -c issues

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 23 Jun 2021 19:49:59 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256794

            Bug ID: 256794
           Summary: netstat -c issues
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs_at_FreeBSD.org
          Reporter: nreilly_at_blackberry.com

In usr.bin/netstat/inet.c protopr() uses so unitialized. Block beginning at
line 242


        if (cflag || Cflag) {
                fnamelen = strlen("Stack");
                cnamelen = strlen("CC");
                oxig = xig = (struct xinpgen *)buf;
                for (xig = (struct xinpgen*)((char *)xig + xig->xig_len);
                    xig->xig_len > sizeof(struct xinpgen);
                    xig = (struct xinpgen *)((char *)xig + xig->xig_len)) {
                        if (istcp) {
                                tp = (struct xtcpcb *)xig;
                                inp = &tp->xt_inp;
                        } else {
                                continue;
                        }
                        if (so->xso_protocol != proto)

Looking at the next block suggests that it is missing:
                        so = &inp->xi_socket;

Also while "-c" is documented in the netstat.1 at line 175, it's missing from
the Synopsis at line 42 and line 114

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Wed Jun 23 2021 - 19:49:59 UTC

Original text of this message