]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r357875: diff: fix segfault with --tabsize and no/malformed argument
authorKyle Evans <kevans@FreeBSD.org>
Mon, 27 Apr 2020 22:50:08 +0000 (22:50 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Mon, 27 Apr 2020 22:50:08 +0000 (22:50 +0000)
commit21949c4f78d666f9bd675bb0d4204cc0b73313ca
tree79100dc7696110bdd92bf4431f49f6cb080984ab
parent7f396f69d68a63e4f3af58e2a0db4c01339d47d7
MFC r357875: diff: fix segfault with --tabsize and no/malformed argument

--tabsize was previously listed as optional_argument, but didn't account for
the optionality of it in the argument handling. This is irrelevant -- the
manpage doesn't indicate that the argument is optional, and indeed there's
no clear interpretation of omitting the argument because there's no other
side effect of --tabsize.

The "malformed" argument part of the header on this message is simply
referring to usage like this:

% diff --tabsize 4 A B

With an optional_argument, the argument must be attached to the parameter
directly (e.g. --tabsize=4), so the argument is effectively NULL with the
above invocation as if no argument had been passed.

PR: 243974
usr.bin/diff/diff.1
usr.bin/diff/diff.c
usr.bin/diff/tests/diff_test.sh