From: Ulrich Drepper Date: Tue, 11 Nov 2003 06:58:52 +0000 (+0000) Subject: (re_string_char_size_at): Don't look beyond valid_len wide chars. X-Git-Tag: cvs/glibc-2_3_3~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=073a39d614ec893159879f0b52179816cb1a5763;p=thirdparty%2Fglibc.git (re_string_char_size_at): Don't look beyond valid_len wide chars. --- diff --git a/posix/regex_internal.h b/posix/regex_internal.h index b2fe766f780..5e113d7c6ac 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;