[Bug 202022] bsdgrep -f crash with null pattern
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sat Aug 1 12:49:44 UTC 2015
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: freebsd-bugs at FreeBSD.org
Reporter: kcwu at csie.org
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.
More information about the freebsd-bugs
mailing list