about summary refs log tree commit diff
path: root/posix/regex_internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/regex_internal.c')
-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