Re: [CFR] diskpart(1) buffer overflow fix

Thomas Quinot <[email protected]> Mon, 2 Dec 2002 13:37:52 +0100
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
Le 2002-12-02, Peter Pentchev écrivait :

> > Attached are two patches: a trivial one which just fixes up two problems
> > in diskpart's argument parsing, and a more complex one, which does it
> > "the right way" IMHO, using getopt(3).

The getopt-based version sounds better to me.

> +			case 'd':
> +				dflag++;
> +				if (pflag)
> +					usage();
> +				break;
> +				
> +			case 'p':
> +				if (dflag)
> +					usage();
> +				pflag++;
> +				break;

I'd remove both tests and replace them with a single
  if (pflag && dflag) usage()
after all arguments have been processed.

Thomas.

-- 
    [email protected]

To Unsubscribe: send mail to [email protected]
with "unsubscribe freebsd-audit" in the body of the message