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.
Created attachment 114711 [details] patch to test return from memchr()
Guess I should not do a refresh from that page. 8) *** This bug has been marked as a duplicate of 158506 ***