New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Sun Apr 3 02:46:30 UTC 2022


Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.

4 new defect(s) introduced to LibreOffice found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)


** CID 1503361:  Incorrect expression  (USELESS_CALL)


________________________________________________________________________________________________________
*** CID 1503361:  Incorrect expression  (USELESS_CALL)
/sw/source/core/unocore/unocontentcontrol.cxx: 694 in SwXContentControl::getPropertyValue(const rtl::OUString &)()
688             if (m_pImpl->m_bIsDescriptor)
689             {
690                 aRet <<= m_pImpl->m_bShowingPlaceHolder;
691             }
692             else
693             {
>>>     CID 1503361:  Incorrect expression  (USELESS_CALL)
>>>     Calling "this->m_pImpl->m_pContentControl->GetShowingPlaceHolder()" is only useful for its return value, which is ignored.
694                 m_pImpl->m_pContentControl->GetShowingPlaceHolder();
695             }
696         }
697         else
698         {
699             throw beans::UnknownPropertyException();

** CID 1503360:  Null pointer dereferences  (NULL_RETURNS)


________________________________________________________________________________________________________
*** CID 1503360:  Null pointer dereferences  (NULL_RETURNS)
/sw/source/core/doc/doctxm.cxx: 938 in SwTOXBaseSection::Update(const SfxItemSet *, const SwRootFrame *, bool)()
932                                    GetSortAlgorithm() );
933     
934         m_aSortArr.clear();
935     
936         // find the first layout node for this TOX, if it only find the content
937         // in his own chapter
>>>     CID 1503360:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" "pSectNd->FindSectionNode()" when calling "GetSectionLevel".
938         const SwTextNode* pOwnChapterNode = IsFromChapter()
939             ? ::lcl_FindChapterNode( *pSectNd, pLayout, pSectNd->FindSectionNode()->GetSectionLevel() + 1 )
940             : nullptr;
941     
942         SwNode2LayoutSaveUpperFrames aN2L(*pSectNd);
943         const_cast<SwSectionNode*>(pSectNd)->DelFrames();

** CID 1503359:  Error handling issues  (CHECKED_RETURN)
/filter/source/xsltdialog/xmlfiltertestdialog.cxx: 429 in XMLFilterTestDialog::doExport(const com::sun::star::uno::Reference<com::sun::star::lang::XComponent> &)()


________________________________________________________________________________________________________
*** CID 1503359:  Error handling issues  (CHECKED_RETURN)
/filter/source/xsltdialog/xmlfiltertestdialog.cxx: 429 in XMLFilterTestDialog::doExport(const com::sun::star::uno::Reference<com::sun::star::lang::XComponent> &)()
423                 OUString aTempFileURL( aTempFile.GetURL() );
424     
425                 const application_info_impl* pAppInfo = getApplicationInfo( m_xFilterInfo->maExportService );
426                 if( pAppInfo )
427                 {
428                     File aOutputFile( aTempFileURL );
>>>     CID 1503359:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "open" without checking return value (as is done elsewhere 87 out of 96 times).
429                     /* File::RC rc = */ aOutputFile.open( osl_File_OpenFlag_Write );
430     
431                     // create xslt exporter
432                     Reference< XOutputStream > xIS( new comphelper::OSLOutputStreamWrapper( aOutputFile ) );
433                     int bUseDocType = m_xFilterInfo->maDocType.isEmpty()  ? 0 : 1;
434                     Sequence< PropertyValue > aSourceData( 2 + bUseDocType );

** CID 1503358:    (CHECKED_RETURN)
/filter/source/xsltdialog/xmlfiltertestdialog.cxx: 602 in XMLFilterTestDialog::import(const rtl::OUString &)()
/filter/source/xsltdialog/xmlfiltertestdialog.cxx: 589 in XMLFilterTestDialog::import(const rtl::OUString &)()


________________________________________________________________________________________________________
*** CID 1503358:    (CHECKED_RETURN)
/filter/source/xsltdialog/xmlfiltertestdialog.cxx: 602 in XMLFilterTestDialog::import(const rtl::OUString &)()
596                         comphelper::makePropertyValue("Indent", true)
597                     };
598     
599                     Reference< XWriter > xWriter = Writer::create( mxContext );
600     
601                     File aOutputFile( aTempFileURL );
>>>     CID 1503358:    (CHECKED_RETURN)
>>>     Calling "open" without checking return value (as is done elsewhere 87 out of 96 times).
602                     aOutputFile.open( osl_File_OpenFlag_Write );
603     
604                     Reference< XOutputStream > xOS( new OSLOutputStreamWrapper( aOutputFile ) );
605                     xWriter->setOutputStream( xOS );
606     
607                     Sequence< OUString > aFilterUserData( m_xFilterInfo->getFilterUserData() );
/filter/source/xsltdialog/xmlfiltertestdialog.cxx: 589 in XMLFilterTestDialog::import(const rtl::OUString &)()
583                 OUString aTempFileURL( aTempFile.GetURL() );
584     
585                 Reference< XImportFilter > xImporter( mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.documentconversion.XSLTFilter", mxContext ), UNO_QUERY );
586                 if( xImporter.is() )
587                 {
588                     osl::File aInputFile( rURL );
>>>     CID 1503358:    (CHECKED_RETURN)
>>>     Calling "open" without checking return value (as is done elsewhere 87 out of 96 times).
589                     aInputFile.open( osl_File_OpenFlag_Read );
590     
591                     Reference< XInputStream > xIS( new comphelper::OSLInputStreamWrapper( aInputFile ) );
592     
593                     Sequence< PropertyValue > aSourceData{
594                         comphelper::makePropertyValue("InputStream", xIS),


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DDzkY_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiyITamcrK-2BKikEIpDqH9CNwVmDW7peSREocWc0ASlN1dzjdiQ0bYCKwiWAmF7k-2FVleCynP3QrWF2J50rQqzNlY3m7ShyZvbcKB0deiKsR5S5zelxinv11p1jjiwHMKkYtibe-2BfjDKJCFFQrpjOs42VksMXXb44GOKusI3NgpysH8-3D



More information about the LibreOffice mailing list