From owner-freebsd-bugs@FreeBSD.ORG Sat Jan 10 14:10:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796C8106564A for ; Sat, 10 Jan 2009 14:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 67BE38FC21 for ; Sat, 10 Jan 2009 14:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n0AEA3k1068493 for ; Sat, 10 Jan 2009 14:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n0AEA3rF068492; Sat, 10 Jan 2009 14:10:03 GMT (envelope-from gnats) Date: Sat, 10 Jan 2009 14:10:03 GMT Message-Id: <200901101410.n0AEA3rF068492@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: "Li yonggang" Cc: Subject: Re: bin/130300: netstat crash when params is incorrect X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Li yonggang List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2009 14:10:03 -0000 The following reply was made to PR bin/130300; it has been noted by GNATS. From: "Li yonggang" To: "Ruslan Ermilov" 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 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 >