basctl/source/basicide/basobj2.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 43cec3f814e509a257eec597baf8bbeb568eb7d9
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Oct 17 13:52:00 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Oct 17 22:23:01 2024 +0200

    tdf#163486: PVS: nullptr dereference
    
    V595: The 'pMethod' pointer was utilized before it was verified against 
nullptr. Check lines: 392, 394.
    
    Change-Id: I7c3cdcf9aacb76ca261733924dc238e836036433
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175080
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/basctl/source/basicide/basobj2.cxx 
b/basctl/source/basicide/basobj2.cxx
index 1cb6f23fe2b3..48c09c039388 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -389,9 +389,9 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& 
rDocument, const OUSt
         for ( sal_uInt32 i = 0 ; i < nCount; ++i )
         {
             SbMethod* pMethod = 
static_cast<SbMethod*>(pMod->GetMethods()->Get(i));
+            assert(pMethod && "Method not found! (NULL)");
             if( pMethod->IsHidden() )
                 continue;
-            assert(pMethod && "Method not found! (NULL)");
             aSeqMethods.getArray()[ iTarget++ ] = pMethod->GetName();
         }
     }

Reply via email to