Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

Abdelrazak> Hello, I had a crash in utf8_to_ucs4() when loading a
Abdelrazak> document which had an empty inset apparently (Intro.lyx).
Abdelrazak> The following commit adds some sanity checks to unicode.C.

It would be nice to know what is the exact inset that triggered it...
I suspect that your fix could hide a real problem.

If you comment out the checks in unicode.C: utf8_to_ucs4() and load the file Intro.lyx, you will have a crash.

The problem lies in  InsetBase::readInset(), line 351/352:

                InsetCommandParams inscmd(cmdName);
                inscmd.read(lex);

And then in InsetCommandParams::read(), insetcommandparams.C, line 264:

                if (i >= 0) {
                        lex.next(true);
                        params_[i] = lex.getDocString();

And then in lyxlex_pimpl.C, line 76:

lyx::docstring const LyXLex::Pimpl::getDocString() const
{
        std::vector<lyx::char_type> res = utf8_to_ucs4(buff);

here buff is empty, hence the crash.

Abdel.

Reply via email to