URL:
<http://savannah.gnu.org/bugs/?30771>
Summary: gnu grep segfault from incorrect option to -f
Project: grep
Submitted by: None
Submitted on: Fri 13 Aug 2010 09:40:21 PM UTC
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
The following example gives a segfault in GNU grep (v2.6.3):
echo hi | grep -Fi -f /tmp/
Of course, that is an incorrect grep invocation, but the behavior is
inconsistent with this example:
echo hi | grep -Fi -f /tmp/
Here grep fails with exit code 1 as if there were no matches.
I recommend just adding a simple check that the filename argument of the -f
option does in fact refer to a regular file.
Thanks,
Bake Timmons
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30771>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/