[Libreoffice] [PATCH] fix for fdo#40831 - Writer will crash when searching text with using regular expressions

Tomofumi Yagi yagit at mknada.sakura.ne.jp
Wed Nov 16 07:08:25 PST 2011


Hi Cedric,

Thanks a lot for your reviewing.
I am very happy to hear the opinions of the expert.


(11/11/15 18:30), Cedric Bosdonnat wrote:
>   * The if should be like the following or we still have the crash when
> the last line is removed.
>      if( pSavePos&&  pSavePos->nNode<  uNodeCount )

I was wrong.
Thanks for pointing out.
I attached a revised patch.

>   * Then I have no idea why you added the checks on the nIdx, I have the
> impression that this is not really needed.
>
>

The verificationwill avoid the strange behavior such as the 
following(not a crash).

Steps to reproduce:
1. Create a new document
2. Type AAA
3. Edit > Find & replace
4. Find : A+
5. Replace with nothing
6. Check « Regular expressions »
7. Click “Replace all''
8. Close dialog.
9. Type B
10. Type Backspace key.
11. B is not deleted.

I think thatthis strange behavior should be corrected in the 
"SwCursor::RestoreSavePos()" method,
and "SwCursor::RestoreSavePos()" method should note both 
"pSavePos->nNode" and "pSavePos->nCntnt" value.
So I added the verification.
But, perhaps, the verificationmay not be included in the same commit to 
fix fdo#40831.
I noticed in your point,and I'm still wondering.

Please tell me your opinion again,If you think that you need.

Best regards,
-- 
Tomofumi Yagi

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-fix-fdo40831-Writer-will-crash-when-searching-text-with-using-regular-expressions.patch
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20111117/a898e51f/attachment.asc>


More information about the LibreOffice mailing list