X-Spam-Check-By: sourceware.org Message-ID: <45BA88EF.FC91A2E7@dessent.net> Date: Fri, 26 Jan 2007 15:04:15 -0800 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com CC: bug-grep AT gnu DOT org Subject: Re: grep -P segfault References: <20070126220628 DOT 76419 DOT qmail AT hyperreal DOT org> <45BA8699 DOT D1E474EA AT dessent DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Brian Dessent wrote: > Right before calling memchr, beg points to the first byte in the string > "hello\n", end points to the \n character, and so does buflim. Thus > (buflim - end) is zero, and memchr returns NULL. From there match_size > is miscalculated and from there it's all downhill. The test for EOL > should be skipped if buflim == end. I see this is an old bug, reported and fixed in CVS nearly two years ago: http://lists.gnu.org/archive/html/bug-grep/2005-02/msg00052.html http://savannah.gnu.org/bugs/?4531 And yet apparently the last released version is still 2.5.1a from 19-Nov-2004. Sigh. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/