about summary refs log tree commit diff
path: root/posix/regex_internal.c
diff options
context:
space:
mode:
authorStanislav Brabec <sbrabec@suse.cz>2012-02-28 16:16:45 +0100
committerAndreas Jaeger <aj@suse.de>2012-02-28 16:16:45 +0100
commit71b5d1c5d5a7ca0f8c047b07e5507857fcd29f97 (patch)
tree4ba1f111e4f9077efd9842ead4203ae5e2ff46bb /posix/regex_internal.c
parent450bf206b4eba7e2288bc6c6e487f60e26165dce (diff)
downloadglibc-71b5d1c5d5a7ca0f8c047b07e5507857fcd29f97.tar.gz
glibc-71b5d1c5d5a7ca0f8c047b07e5507857fcd29f97.tar.xz
glibc-71b5d1c5d5a7ca0f8c047b07e5507857fcd29f97.zip
[BZ #13637]
	* posix/regex_internal.c (re_string_skip_chars): Fix miscomputation
	of remain_len that may cause incomplete multi-byte character and
	false match.
	* posix/bug-regex33.c: New file.
	* posix/Makefile (tests): Add bug-regex33.
Diffstat (limited to 'posix/regex_internal.c')
-rw-r--r--posix/regex_internal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index b71eae4c9f..9be8a532e6 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -499,7 +499,7 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc)
        rawbuf_idx < new_raw_idx;)
     {
       wchar_t wc2;
-      int remain_len = pstr->len - rawbuf_idx;
+      int 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);