Re: MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-17 Thread Derek Martin
On Fri, Jul 18, 2008 at 12:22:22AM +0900, TAKAHASHI Tamotsu wrote: > > Let's pretend for a moment that we have a case where every character > > in the input text needs to get converted to a string which has a > > lenght of ibl * 8 bytes. If I read it correctly, your patch will go > > into an infi

Re: MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-17 Thread TAKAHASHI Tamotsu
* Thu Jul 17 2008 Derek Martin <[EMAIL PROTECTED]> > On Thu, Jul 17, 2008 at 12:48:14PM +0900, TAKAHASHI Tamotsu wrote: > > * Wed Jul 16 2008 Paul Walker <[EMAIL PROTECTED]> > > > On Wed, Jul 16, 2008 at 02:34:06PM +0900, TAKAHASHI Tamotsu wrote: > > > > > > > +while (mutt_iconv (cd, &ib, &ibl

Re: MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-17 Thread Derek Martin
On Thu, Jul 17, 2008 at 12:48:14PM +0900, TAKAHASHI Tamotsu wrote: > * Wed Jul 16 2008 Paul Walker <[EMAIL PROTECTED]> > > On Wed, Jul 16, 2008 at 02:34:06PM +0900, TAKAHASHI Tamotsu wrote: > > > > > +while (mutt_iconv (cd, &ib, &ibl, &ob, &obl, inrepls, outrepl) == > > > (size_t)-1) > > [...

Re: MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-16 Thread TAKAHASHI Tamotsu
* Wed Jul 16 2008 Paul Walker <[EMAIL PROTECTED]> > On Wed, Jul 16, 2008 at 02:34:06PM +0900, TAKAHASHI Tamotsu wrote: > > > +while (mutt_iconv (cd, &ib, &ibl, &ob, &obl, inrepls, outrepl) == > > (size_t)-1) > [...] > > + safe_realloc (&buf, len + obl + 1); > > +} > > Is it possible

Re: MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-16 Thread Paul Walker
On Wed, Jul 16, 2008 at 02:34:06PM +0900, TAKAHASHI Tamotsu wrote: > +while (mutt_iconv (cd, &ib, &ibl, &ob, &obl, inrepls, outrepl) == > (size_t)-1) [...] > + safe_realloc (&buf, len + obl + 1); > +} Is it possible to add some kind of limit condition on this? Call me paranoid, but

Re: MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-15 Thread Rocco Rutte
Hi, * TAKAHASHI Tamotsu wrote: BTW, Changelog tells that 0eacf5297484 was to "prevent crashes if MB_LEN_MAX<6", but utf8.c is enabled only "#ifndef HAVE_WC_FUNCS", which means MB_LEN_MAX==16 (see mutt.h). So I'm afraid the change changed nothing. Basically yes. But letting that function writi

Re: MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-15 Thread TAKAHASHI Tamotsu
* Sun Jul 13 2008 TAKAHASHI Tamotsu <[EMAIL PROTECTED]> > Now mutt depends on UTF-8, so MB_LEN_MAX needs to be > at least 6. Therefore I suggest mutt.h checks it. A multibyte guru NOZAKI-san told me that that is not enough. You must expect errno==E2BIG even if you malloc'ed MB_LEN_MAX * ibl bytes.

MB_LEN_MAX has to be more than 5 if mutt uses UTF-8

2008-07-13 Thread TAKAHASHI Tamotsu
Hi, I've just started using mutt-1.5.18 and found that hcache strings are now converted to UTF-8. (flea#3023) But it causes a problem on OpenBSD i386 machines because MB_LEN_MAX==1 there. (i.e. EUC-JP kanji strings can be truncated.) Now mutt depends on UTF-8, so MB_LEN_MAX needs to be at least