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

            Bug ID: 202022
           Summary: bsdgrep -f crash with null pattern
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

How to repeat:
$ printf "\0" > nul
$ bsdgrep -f nul /COPYRIGHT
Segmentation fault (core dumped)

According to
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getdelim.html
"Although a NUL terminator is always supplied after the line, note that
strlen(*lineptr) will be smaller than the return value if the line contains
embedded NUL characters."

bsdgrep didn't handle embedded NULL characters inside the pattern.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to