aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-11-11 06:58:52 +0000
committerUlrich Drepper <drepper@redhat.com>2003-11-11 06:58:52 +0000
commit073a39d614ec893159879f0b52179816cb1a5763 (patch)
treee1b419bafc072c1dafbd32c39177274254a3f547
parent* manual/examples/dir2.c (one): Add const to argument type. (diff)
downloadglibc-073a39d614ec893159879f0b52179816cb1a5763.tar.gz
glibc-073a39d614ec893159879f0b52179816cb1a5763.tar.bz2
glibc-073a39d614ec893159879f0b52179816cb1a5763.zip
(re_string_char_size_at): Don't look beyond valid_len wide chars.
-rw-r--r--posix/regex_internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index b2fe766f78..5e113d7c6a 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -702,7 +702,7 @@ re_string_char_size_at (pstr, idx)
int byte_idx;
if (MB_CUR_MAX == 1)
return 1;
- for (byte_idx = 1; idx + byte_idx < pstr->len; ++byte_idx)
+ for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx)
if (pstr->wcs[idx + byte_idx] != WEOF)
break;
return byte_idx;