Bug 158536 - grep segfaults when all of color, context, match, ignorecase set
grep segfaults when all of color, context, match, ignorecase set
Status: CLOSED DUPLICATE of bug 158506
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-23 09:10 EDT by Doug Maxey
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-23 09:13:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to test return from memchr() (729 bytes, patch)
2005-05-23 09:10 EDT, Doug Maxey
no flags Details | Diff

  None (edit)
Description Doug Maxey 2005-05-23 09:10:47 EDT
Description of problem:
When using the command 
grep --color=auto --ignore-case --before-context 1 --after-context=4 --max-count
10 SEARCH-ARG FILE
a segfault is produced in for the _last_ match in search.c

Version-Release number of selected component (if applicable):
grep-2.5.1-31.4

How reproducible:
100%

Actual results:
grep segfaults.

Expected results:
colorized context printed up to match times.

Additional info:
The faulting function is src/search.c::EGexecute::memchr().  The starting
address "beg" is passed as 1.  This was caused by the NULL return from the
previous call to memchr() and the loop continues.
Comment 1 Doug Maxey 2005-05-23 09:10:47 EDT
Created attachment 114711 [details]
patch to test return from memchr()
Comment 2 Doug Maxey 2005-05-23 09:13:44 EDT
Guess I should not do a refresh from that page. 8)

*** This bug has been marked as a duplicate of 158506 ***

Note You need to log in before you can comment on or make changes to this bug.