[Fwd]: Re: Patch: Fix for Bug 1164, 2nd try


Subject: [Fwd]: Re: Patch: Fix for Bug 1164, 2nd try
From: ha shao (hashao@chinese.com)
Date: Sun Jun 03 2001 - 10:05:19 CDT


Please commit the patch for possible iconv corruption.

----- Forwarded message from ha shao <hashao@chinese.com> -----

From: ha shao <hashao@chinese.com>
To: abiword-dev <abiword-dev@abisource.com>
Date: Wed, 23 May 2001 09:51:30 +0800
Content-Type: multipart/mixed; boundary="3V7upXqbjpZ4EhLz"
User-Agent: Mutt/1.2.5i
Subject: Re: Patch: Fix for Bug 1164, 2nd try

On Tue, May 22, 2001 at 10:18:00PM +0500, hvv@hippo.ru wrote:
> On Tue, 22 May 2001, ha shao wrote:
> > Oh the clean up thing should be done inside mbtowc when the actual
> > conversion is failed.
>
> It's done already - please see the /src/af/util/xp/ut_mbtowc.cpp - method
> UT_Mbtowc::mbtowc (the last one).
>

Yes and no. It seems the intent for the initialize() RTF importer
is to also reset iconv when we have no enough input too. But this
kind of reset is specifically skipped in UT_Mbtowc::mbtowc().

Since the aggregate buffer is maintained by UT_Mbtowc itself, just
reset like the attached buffer will do. Dom might want to test if
this solved the iconv related SEGV.

-- 
Best regard
hashao

Index: ut_mbtowc.cpp =================================================================== RCS file: /cvsroot/abi/src/af/util/xp/ut_mbtowc.cpp,v retrieving revision 1.18 diff -u -r1.18 ut_mbtowc.cpp --- ut_mbtowc.cpp 2001/05/20 12:50:18 1.18 +++ ut_mbtowc.cpp 2001/05/23 01:47:47 @@ -275,8 +275,10 @@ m_bufLen = 0; return 1; } else { - if (errno==EINVAL) + if (errno==EINVAL) { + UT_iconv_reset(cd); /* reset iconv, pointer might be messed up. */ return 0; /* need more chars */ + } else { initialize();/*wrong seq*/ return 0;

----- End forwarded message -----

-- Best regard hashao



This archive was generated by hypermail 2b25 : Sun Jun 03 2001 - 10:04:39 CDT