aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-07-18 03:16:51 +0000
committerRoland McGrath <roland@gnu.org>2005-07-18 03:16:51 +0000
commit5fc51bde45580a1bd81b35cf70794fd2770a1125 (patch)
tree9de7ec12eb9a41f934451ed8165b0086c4387359
parent2005-02-11 Jakub Jelinek <jakub@redhat.com> (diff)
downloadglibc-5fc51bde45580a1bd81b35cf70794fd2770a1125.tar.xz
glibc-5fc51bde45580a1bd81b35cf70794fd2770a1125.zip
2005-07-05 Ulrich Drepper <drepper@redhat.com>
[BZ #1101] * posix/regex_internal.c (build_wcs_buffer): Use MB_LEN_MAX not MB_CUR_MAX. (build_wcs_upper_buffer): Likewise. 2005-03-05 Ulrich Drepper <drepper@redhat.com> [BZ #1101] * posix/regex_internal.c [_LIBC] (build_wcs_buffer): Avoid using dynamically sized array. (build_wcs_upper_buffer): Likewise.
-rw-r--r--posix/regex_internal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index 001b50b134..d590104fce 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -214,7 +214,8 @@ build_wcs_buffer (pstr)
re_string_t *pstr;
{
#ifdef _LIBC
- unsigned char buf[pstr->mb_cur_max];
+ unsigned char buf[MB_LEN_MAX];
+ assert (MB_LEN_MAX >= pstr->mb_cur_max);
#else
unsigned char buf[64];
#endif
@@ -282,7 +283,8 @@ build_wcs_upper_buffer (pstr)
mbstate_t prev_st;
int src_idx, byte_idx, end_idx, mbclen, remain_len;
#ifdef _LIBC
- unsigned char buf[pstr->mb_cur_max];
+ unsigned char buf[MB_LEN_MAX];
+ assert (MB_LEN_MAX >= pstr->mb_cur_max);
#else
unsigned char buf[64];
#endif