Issue 90612

Summary: sd: insert->file with password protected document
Product: Draw Reporter: caolanm
Component: codeAssignee: wolframgarten
Status: CLOSED FIXED QA Contact: issues@graphics <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: DEV300m18   
Target Milestone: OOo 3.0   
Hardware: All   
OS: Linux, all   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
patch to avoid crash none

Description caolanm 2008-06-11 12:30:09 UTC
If I create a password protected .odg and then create a new presentation and use
file->insert and select the password protected .odg and continually press ok it
will crash with 

    SfxFilterMatcher::GuessFilterControlDefaultUI(SfxMedium&, SfxFilter const**,
unsigned long, unsigned long, unsigned char) const
    /usr/src/debug/OOG680_m6/sfx2/source/bastyp/fltfnc.cxx:549
/usr/lib/openoffice.org/program/libsfx680li.so : 0x240730
    SfxFilterMatcher::GuessFilter(SfxMedium&, SfxFilter const**, unsigned long,
unsigned long) const
    /usr/src/debug/OOG680_m6/sfx2/source/bastyp/fltfnc.cxx:530
/usr/lib/openoffice.org/program/libsd680li.so : 0x192ADB
    SdDrawDocument::OpenBookmarkDoc(SfxMedium&)
    /usr/src/debug/OOG680_m6/sd/source/core/drawdoc3.cxx:156
/usr/lib/openoffice.org/program/libsd680li.so : 0x16B4D0
    SdPageObjsTLB::GetBookmarkDoc(SfxMedium*)

When happens is the the first time we attempt to get the bookmarks in
SdPageObjsTLB::GetBookmarkDoc we use 
mpBookmarkDoc = ((SdDrawDocument*) mpDoc)->OpenBookmarkDoc(*mpMedium);
if this fails the underlying mpDoc has closed the mpMedium on us and it is now
invalid. If we attempt to use it again on the next cycle then we crash.

So something like the following patch looks indicated, or an additional
reference taken by the dialog to ensure it remains open.
Comment 1 caolanm 2008-06-11 12:30:42 UTC
Created attachment 54398 [details]
patch to avoid crash
Comment 2 wolframgarten 2008-06-11 13:26:31 UTC
Reassigned. Please handle.
Comment 3 clippka 2008-06-18 11:47:18 UTC
I can reproduce the crash and the patch indeed fixes it. The perfect fix would
be to ask the user for a password at the first place but I will commit this
patch now to at least safe the crash. Thanks for the patch!

Applied to cws impress145 for OOo 3.0
Comment 4 clippka 2008-06-23 11:19:58 UTC
*** Issue 90970 has been marked as a duplicate of this issue. ***
Comment 5 clippka 2008-06-25 15:28:32 UTC
verified in cws, crash fixed
Comment 6 wolframgarten 2008-06-27 09:51:53 UTC
Verified in CWS.
Comment 7 wolframgarten 2008-07-07 11:55:55 UTC
Tested in DEV300_m23.