[illumos-Developer] Webrev for bug 900: sed errors when -e is given a 0-length argument
Gary Mills
mills at cc.umanitoba.ca
Wed Apr 27 19:23:32 PDT 2011
On Wed, Apr 27, 2011 at 08:41:25PM -0400, Dan McDonald wrote:
> On Wed, Apr 27, 2011 at 07:24:02PM -0500, Gary Mills wrote:
> <SNIP!>
> > It was fixed by reverting to the freebsd code for option handling.
> > This minimizes the changes needed to port it to Illumos. While
> > `asprintf' is handy, it's only used in that one place in the sed
> > source. There's no need to introduce it in this case.
>
> Seeing vanilla strcpy() with two variables for arguments (one from user
> input!) raises my hackles, but the strlen() on the user-input string
> *probably* provides a sufficient correctness predicate. Some automatic
> source-checkers will probably complain about this, though.
>
> Comments are nice to assuage such fears. ;)
Since this possible error exists in the original BSD code, I'd suggest
that any change here should be fed upstream. I also wouldn't want to
put a comment in there unless I were certain of it.
--
-Gary Mills- -Unix Group- -Computer and Network Services-
More information about the Developer
mailing list