I installed this and file glibc bug 1286: 2005-09-01 Paul Eggert <[EMAIL PROTECTED]>
* lib/regex_internal.c (build_wcs_upper_buffer): Fix portability bugs in int versus size_t comparisons. * config/srclist.txt: Add glibc bug 1285, 1286. --- lib/regex_internal.c 1 Sep 2005 19:41:07 -0000 1.13 +++ lib/regex_internal.c 1 Sep 2005 20:53:43 -0000 @@ -301,7 +301,7 @@ build_wcs_upper_buffer (re_string_t *pst mbclen = mbrtowc (&wc, ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx), remain_len, &pstr->cur_state); - if (BE (mbclen + 2 > 2, 1)) + if (BE ((size_t) (mbclen + 2) > 2, 1)) { wchar_t wcu = wc; if (iswlower (wc)) @@ -369,7 +369,7 @@ build_wcs_upper_buffer (re_string_t *pst else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state); - if (BE (mbclen + 2 > 2, 1)) + if (BE ((size_t) (mbclen + 2) > 2, 1)) { wchar_t wcu = wc; if (iswlower (wc)) @@ -642,6 +642,7 @@ re_string_reconstruct (re_string_t *pstr wchar_t wc2; Idx mlen = raw + pstr->len - p; unsigned char buf[6]; + size_t mbclen; q = p; if (BE (pstr->trans != NULL, 0)) @@ -654,14 +655,13 @@ re_string_reconstruct (re_string_t *pstr /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ memset (&cur_state, 0, sizeof (cur_state)); - mlen = (mbrtowc (&wc2, (const char *) p, mlen, - &cur_state) - - (raw + offset - p)); - if (mlen >= 0) + mbclen = mbrtowc (&wc2, (const char *) p, mlen, + &cur_state); + if (raw + offset - p <= mbclen && mbclen < (size_t) -2) { memset (&pstr->cur_state, '\0', sizeof (mbstate_t)); - pstr->valid_len = mlen; + pstr->valid_len = mbclen - (raw + offset - p); wc = wc2; } break; --- config/srclist.txt.~1.96.~ 2005-09-01 12:41:07.000000000 -0700 +++ config/srclist.txt 2005-09-01 13:59:49.000000000 -0700 @@ -135,6 +135,7 @@ $LIBCSRC/stdlib/getsubopt.c lib gpl # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1282 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1284 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1285 +# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1286 #$LIBCSRC/posix/regex_internal.c lib gpl # # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054 _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib