From b5e62988f8faab0a94b0db0f1da815af8c10b928 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 14 Sep 2000 08:21:48 +0000 Subject: (compile_range): Cast collseq index to unsigned char to avoid accessing data before collseq. --- posix/regex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'posix/regex.c') 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) { -- cgit 1.4.1