Fix for a crash test?
Miklos Vajna
vmiklos at collabora.co.uk
Tue Feb 25 04:05:55 PST 2014
Hi Julien,
On Sat, Feb 22, 2014 at 07:05:39AM -0800, julien2412 <serval2412 at yahoo.fr> wrote:
> On pc Debian x86-64 with master sources updated yesterday, I reproduced the
> crash fdo51430-1.doc.
> The bt shows a failing assert because of the line 2423 of this block:
> 2415 else
> 2416 {
> 2417 //What I do here, is that I examine the attributes, and
> if
> 2418 //I find out, that it's CJK/CTL, then I set the
> paragraph space
> 2419 //to the value set in
> HTML_CJK_PARSPACE/HTML_CTL_PARSPACE.
> 2420
> 2421 sal_Bool bIsCJK = false;
> 2422 sal_Bool bIsCTL = false;
> 2423 SwpHints& rHints = pTxtNode->GetSwpHints(); //// HERE
> 2424 sal_uInt16 nWhich;
> 2425 SwTxtAttr *pHt;
>
> (see
> http://opengrok.libreoffice.org/xref/core/sw/source/filter/html/swhtml.cxx#2415)
>
> If I check pTxtNode->HasHints() on SwHTMLParser::AddParSpace in
> sw/source/filter/html/swhtml.cxx, no crash. But as often, I wonder if it's
> the good fix or if I just hide a bug
In general, GetSwpHints() should only be used after a HasHints() call.
In an import filter, once again in general you are supposed to handle
all kind of strange user input. Based on that, I would just add the
HasHints() check there, unless you want to spend time on checking if the
bugdoc crashed in older versions as well (and if it did not, why that
didn't happen).
Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140225/9be73004/attachment.pgp>
More information about the LibreOffice
mailing list