bug-gnu-utils
[Top][All Lists]
Advanced

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

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


From: Stanislav Brabec
Subject: [PATCH 3/3] grep: Fix false multi-byte matches in some regular expressions
Date: Fri, 10 Feb 2012 20:45:53 +0100

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: address@hidden
Lihovarská 1060/12                            tel: +49 911 7405384547
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/




reply via email to

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