[Bug 243974] diff(1) generates core dump when --tabsize is used

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 13 20:24:43 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243974

--- Comment #5 from commit-hook at freebsd.org ---
A commit references this bug:

Author: kevans
Date: Thu Feb 13 20:23:56 UTC 2020
New revision: 357875
URL: https://svnweb.freebsd.org/changeset/base/357875

Log:
  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

Changes:
  head/usr.bin/diff/diff.1
  head/usr.bin/diff/diff.c
  head/usr.bin/diff/tests/diff_test.sh

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list