freebsd-skq/usr.bin/diff
kevans b4a62267b6 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
Submitted by:	fehmi noyan isi <fnoyanisi yahoo com> (diff.c portion)
MFC after:	3 days
2020-02-13 20:23:55 +00:00
..
tests diff: fix segfault with --tabsize and no/malformed argument 2020-02-13 20:23:55 +00:00
diff.1 diff: fix segfault with --tabsize and no/malformed argument 2020-02-13 20:23:55 +00:00
diff.c diff: fix segfault with --tabsize and no/malformed argument 2020-02-13 20:23:55 +00:00
diff.h diff: implement -y (--side-by-side) along with -W and --suppress-common-lines 2020-02-07 10:17:13 +00:00
diffdir.c diff: Import fixes from OpenBSD 2018-06-09 21:09:24 +00:00
diffreg.c diff: implement -y (--side-by-side) along with -W and --suppress-common-lines 2020-02-07 10:17:13 +00:00
Makefile Isolate the pr(1) related code in its own source files 2018-06-09 20:24:17 +00:00
pr.c Fix memory leak 2018-06-12 16:42:11 +00:00
pr.h Isolate the pr(1) related code in its own source files 2018-06-09 20:24:17 +00:00
TODO Update diff(1) TODO removing what has been implemented 2020-02-07 10:18:01 +00:00
xmalloc.c asprintf returns -1, not an arbitrary value < 0. Also upon error the 2020-01-14 08:18:04 +00:00
xmalloc.h