Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hello,

On master sources updated today, cppcheck reported this :
[sw/source/ui/misc/redlndlg.cxx:402]: (error) Possible null pointer
dereference: pView - otherwise it is redundant to check if pView is null at
line 406

    395 void SwRedlineAcceptDlg::Activate()
    396 {
    397     // prevent update if flag is set (#102547#)
    398     if( bInhibitActivate )
    399         return;
    400 
    401     SwView *pView = ::GetActiveView();
    402     SwWait aWait( *pView->GetDocShell(), sal_False );
    403 
    404     aUsedSeqNo.Remove((sal_uInt16)0, aUsedSeqNo.Count());
    405 
    406     if (!pView) // can happen when switching to another app, when a
Listbox in the dialog
    407         return; // had the focus previously (actually THs Bug)

Should we test pView just after having tested bInhibitActivate or should we
keep this :
aUsedSeqNo.Remove((sal_uInt16)0, aUsedSeqNo.Count());
before testing pView ?

Julien

--
View this message in context: 
http://nabble.documentfoundation.org/Possible-null-pointer-dereference-in-sw-source-ui-misc-redlndlg-cxx-tp3995385.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.