From: Bruno Haible Date: Mon, 24 May 2010 08:53:29 +0000 (+0200) Subject: Fix bug: Avoid out-of-bounds access. X-Git-Tag: v0.18.1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaa93942902485744c1ae0724a68efb2d814cb2d;p=thirdparty%2Fgettext.git Fix bug: Avoid out-of-bounds access. --- diff --git a/gettext-tools/libgrep/ChangeLog b/gettext-tools/libgrep/ChangeLog index a229582f6..0e3951701 100644 --- a/gettext-tools/libgrep/ChangeLog +++ b/gettext-tools/libgrep/ChangeLog @@ -1,3 +1,9 @@ +2010-05-24 Bruno Haible + + Fix bug: Avoid out-of-bounds access. + * m-regex.c (EGexecute): Fix test before second call to + IS_WORD_CONSTITUENT. + 2010-05-24 Bruno Haible Cleanup syntax. diff --git a/gettext-tools/libgrep/m-regex.c b/gettext-tools/libgrep/m-regex.c index d4b49b98c..e3582bcb4 100644 --- a/gettext-tools/libgrep/m-regex.c +++ b/gettext-tools/libgrep/m-regex.c @@ -193,7 +193,7 @@ EGexecute (const void *compiled_pattern, while (start >= 0) { if ((start == 0 || !IS_WORD_CONSTITUENT ((unsigned char) beg[start - 1])) - && (len == end - beg + && (start + len == end - beg || !IS_WORD_CONSTITUENT ((unsigned char) beg[start + len]))) goto success; if (len > 0)