[PATCH 3/3] grep: Fix false multi-byte matches in some regular expressions

Stanislav Brabec <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Organization SUSE Linux, s. r. o.
Message-ID <[email protected]>
However I don't have a reproducer for the bug mentioned in PATCH 1/3, I
believe, that it may appear in grep as well. All other packages that
embed its own copy of regex_internal.c with I18N support enabled are
affected as well.

Index: grep-2.9/lib/regex_internal.c
===================================================================
--- grep-2.9.orig/lib/regex_internal.c
+++ grep-2.9/lib/regex_internal.c
@@ -500,7 +500,7 @@ re_string_skip_chars (re_string_t *pstr,
     {
       wchar_t wc2;
       Idx remain_len;
-      remain_len = pstr->len - rawbuf_idx;
+      remain_len = pstr->raw_len - rawbuf_idx;
       prev_st = pstr->cur_state;
       mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx,
 			  remain_len, &pstr->cur_state);


-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: [email protected]
Lihovarská 1060/12                            tel: +49 911 7405384547
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.