bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-grep] [bug #13161] missing check on memchr() return val in EGex


From: Julian Foad
Subject: Re: [bug-grep] [bug #13161] missing check on memchr() return val in EGexecute
Date: Mon, 23 May 2005 20:06:02 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217

Tim Waugh wrote:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=158506

The upshot is that EGexecute() is missing a check to see if memchr() returned
NULL.  This can happen when len is less than the length of the initial line
passed in.

Thanks for the report and the patch.

Some uncomfortable comments:

I can't reproduce this (with grep 2.5.1):

(echo foo ; echo foo) | grep-2.5.1/src/grep --color=auto --ignore-case --before-context=1 --after-context=4 --max-count=1 foo

prints out "foo" coloured red.

I've a feeling I've seen something very like this bug and patch reported before, but I can't find it now.

There are other similar-looking unchecked uses of "memchr" in the same file.

- Julian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]