about summary refs log tree commit diff
path: root/posix/regex.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-14 08:21:48 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-14 08:21:48 +0000
commitb5e62988f8faab0a94b0db0f1da815af8c10b928 (patch)
tree61a856cc1fb7d714552a5b1aa8beefe1e2535b01 /posix/regex.c
parent7ca5d0dcb3eee499abaa0cf97e37659a490f9413 (diff)
downloadglibc-b5e62988f8faab0a94b0db0f1da815af8c10b928.tar.gz
glibc-b5e62988f8faab0a94b0db0f1da815af8c10b928.tar.xz
glibc-b5e62988f8faab0a94b0db0f1da815af8c10b928.zip
(compile_range): Cast collseq index to unsigned char to avoid accessing data before collseq.
Diffstat (limited to 'posix/regex.c')
-rw-r--r--posix/regex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/posix/regex.c b/posix/regex.c
index b4adfcf6ed..bff88c5412 100644
--- a/posix/regex.c
+++ b/posix/regex.c
@@ -3531,11 +3531,11 @@ compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
   collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
 						 _NL_COLLATE_COLLSEQMB);
 
-  start_colseq = collseq[TRANSLATE (range_start_char)];
-  end_colseq = collseq[TRANSLATE (p[0])];
+  start_colseq = collseq[(unsigned char) TRANSLATE (range_start_char)];
+  end_colseq = collseq[(unsigned char) TRANSLATE (p[0])];
   for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
     {
-      unsigned int this_colseq = collseq[TRANSLATE (this_char)];
+      unsigned int this_colseq = collseq[(unsigned char) TRANSLATE (this_char)];
 
       if (start_colseq <= this_colseq && this_colseq <= end_colseq)
 	{