Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2009 13:10:02 GMT
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/130300: netstat crash when params is incorrect
Message-ID:  <200901101310.n0ADA28w023973@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: Ruslan Ermilov <ru@FreeBSD.org>
To: Li yonggang <leeygang@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/130300: netstat crash when params is incorrect
Date: Sat, 10 Jan 2009 15:31:30 +0300

 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?200901101310.n0ADA28w023973>