Date: Thu, 8 Jan 2009 14:03:58 +0000 From: "Li yonggang" <leeygang@gmail.com> To: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org Subject: Re: bin/130300: netstat crash when params is incorrect Message-ID: <6742fb710901080603h26de41eat397b40df7fc48873@mail.gmail.com> In-Reply-To: <200901081320.n08DK2D1097425@freefall.freebsd.org> References: <200901081318.n08DIkuj021838@www.freebsd.org> <200901081320.n08DK2D1097425@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] correct the patch files:). On 1/8/09, FreeBSD-gnats-submit@freebsd.org <FreeBSD-gnats-submit@freebsd.org> wrote: > Thank you very much for your problem report. > It has the internal identification `bin/130300'. > The individual assigned to look at your > report is: freebsd-bugs. > > You can access the state of your problem report at any time > via this link: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=130300 > >>Category: bin >>Responsible: freebsd-bugs >>Synopsis: netstat crash when params is incorrect >>Arrival-Date: Thu Jan 08 13:20:02 UTC 2009 > [-- Attachment #2 --] *** main.c Tue Jan 6 15:01:25 2009 --- ../main.c Thu Jan 8 13:57:38 2009 *************** *** 341,346 **** --- 341,347 ---- int af; /* address family */ int live; /* true if we are examining a live system */ + int main(int argc, char *argv[]) { *************** *** 463,489 **** default: usage(); } ! argv += optind; ! argc -= optind; ! ! #define BACKWARD_COMPATIBILITY ! #ifdef BACKWARD_COMPATIBILITY ! if (*argv) { ! if (isdigit(**argv)) { ! interval = atoi(*argv); ! if (interval <= 0) ! usage(); ! ++argv; ! iflag = 1; ! } ! if (*argv) { ! nlistf = *argv; ! if (*++argv) ! memf = *argv; ! } ! } ! #endif ! /* * Discard setgid privileges if not the running kernel so that bad * guys can't print interesting stuff from kernel memory. --- 464,474 ---- default: usage(); } ! /* ! * Params should be parsed without error. ! * */ ! if(*(argv += optind)) ! usage(); /* * Discard setgid privileges if not the running kernel so that bad * guys can't print interesting stuff from kernel memory.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6742fb710901080603h26de41eat397b40df7fc48873>
