[Bug 241714] /usr/bin/diff --tabsize dies with SIGSEGV

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Nov 20 06:19:44 UTC 2019


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

pprocacci at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pprocacci at gmail.com

--- Comment #3 from pprocacci at gmail.com ---
tabsize is set to have an optional argument.
I can't explain why as it seems to me it always require an argument.
This patch here makes tabsize require an argument which also solves the problem
of the SEGfault as line 255 of diff.c is expecting optarg to be something.


--- diff.c.orig 2019-11-20 01:16:41.377456000 -0500
+++ diff.c      2019-11-20 01:16:51.176400000 -0500
@@ -90,7 +90,7 @@
        { "no-ignore-file-name-case",   no_argument,            NULL,  
OPT_NO_IGN_FN_CASE },
        { "normal",                     no_argument,            NULL,  
OPT_NORMAL },
        { "strip-trailing-cr",          no_argument,            NULL,  
OPT_STRIPCR },
-       { "tabsize",                    optional_argument,      NULL,  
OPT_TSIZE },
+       { "tabsize",                    required_argument,      NULL,  
OPT_TSIZE },
        { "changed-group-format",       required_argument,      NULL,  
OPT_CHANGED_GROUP_FORMAT},
        { NULL,                         0,                      0,      '\0'}
 };

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


More information about the freebsd-bugs mailing list