Patch: fix intermittent crash in KHTML Thai Word Break

David Faure faure at kde.org
Mon Feb 28 17:20:58 GMT 2005


On Monday 28 February 2005 18:24, Germain Garand wrote:
> Le lundi 28 Février 2005 16:41, Otto Pattara a écrit :
> > On 2005 February 26 Saturday 02:17, Germain Garand wrote:
> > > Le vendredi 25 Février 2005 05:38, Pattara Kiatisevi a écrit :
> > > > Hello,
> > > >
> > > > Regarding the Thai word break patch in KHTML, after testing
> >
> > The backtrace seemed not very informative to me (maybe I need to
> > enable debugging somehow (?) when compiling KHTML).
> >
> > I put some printf in libthai and found that sometimes the input
> > parameter for array size (cache->allocated, in KHTML code) is
> > incredibly large or the  cache->wbrpos array is 0x0. So I suspected
> > there might be something funny about initialization of this "cache"
> > structure. By looking at the code I don't see any mysterious point so
> > I made a fix as in the patch.
> 
> Oh I see...  there is no proper initialization for th_brk. 
> So then the only needed change should be:
> - static th_brk_def th_brk;
> + static th_brk_def th_brk = 0;

AFAIK file-static data is initialized to 0 automatically.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list