Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2009 14:10:03 GMT
From:      "Li yonggang" <leeygang@gmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/130300: netstat crash when params is incorrect
Message-ID:  <200901101410.n0AEA3rF068492@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/130300; it has been noted by GNATS.

From: "Li yonggang" <leeygang@gmail.com>
To: "Ruslan Ermilov" <ru@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: bin/130300: netstat crash when params is incorrect
Date: Sat, 10 Jan 2009 22:01:19 +0800

 I dont think netstat -N foo -m and netstat -m foo are exactly the same bug.
 the crash of netstat -N foo -m is caused by not providing -M option to
 specify the dump file, while the crash of netstat -m foo is caused not
 check illegal params.
 but I agree to fix them  in bug 124724 together.
 
 
 On Sat, Jan 10, 2009 at 8:31 PM, Ruslan Ermilov <ru@freebsd.org> wrote:
 > The problem is not with the backward compatibility code -- you'll
 > get the same crash with "netstat -N foo -m" as well.  The proper
 > fix is as follows:
 >
 > %%%
 > Index: main.c
 > ===================================================================
 > RCS file: /home/ncvs/src/usr.bin/netstat/main.c,v
 > retrieving revision 1.87.2.1
 > diff -u -p -r1.87.2.1 main.c
 > --- main.c      16 Mar 2008 07:20:18 -0000      1.87.2.1
 > +++ main.c      10 Jan 2009 12:25:32 -0000
 > @@ -499,7 +499,7 @@ main(int argc, char *argv[])
 >                exit(0);
 >        }
 >        if (mflag) {
 > -               if (memf != NULL) {
 > +               if (!live) {
 >                        if (kread(0, NULL, 0) == 0)
 >                                mbpr(kvmd, nl[N_MBSTAT].n_value);
 >                } else
 > %%%
 >
 >
 > Cheers,
 > --
 > Ruslan Ermilov
 > ru@FreeBSD.org
 > FreeBSD committer
 >



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901101410.n0AEA3rF068492>