New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Wed Jan 17 12:42:36 UTC 2018
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
7 new defect(s) introduced to LibreOffice found with Coverity Scan.
4 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 7 of 7 defect(s)
** CID 1427633: Resource leaks (CTOR_DTOR_LEAK)
/idlc/source/idlc.cxx: 212 in Idlc::Idlc(Options *)()
________________________________________________________________________________________________________
*** CID 1427633: Resource leaks (CTOR_DTOR_LEAK)
/idlc/source/idlc.cxx: 212 in Idlc::Idlc(Options *)()
206 , m_warningCount(0)
207 , m_lineNumber(0)
208 , m_offsetStart(0)
209 , m_offsetEnd(0)
210 , m_parseState(PS_NoState)
211 {
>>> CID 1427633: Resource leaks (CTOR_DTOR_LEAK)
>>> The constructor allocates field "m_pScopes" of "Idlc" but the destructor and whatever functions it calls do not free it.
212 m_pScopes = new AstStack();
213 // init root object after construction
214 m_pRoot = nullptr;
215 m_bGenerateDoc = m_pOptions->isValid("-C");
216 }
217
** CID 1427632: API usage errors (INVALIDATE_ITERATOR)
/dbaccess/source/ui/tabledesign/TableUndo.cxx: 212 in dbaui::OTableEditorDelUndoAct::Redo()()
________________________________________________________________________________________________________
*** CID 1427632: API usage errors (INVALIDATE_ITERATOR)
/dbaccess/source/ui/tabledesign/TableUndo.cxx: 212 in dbaui::OTableEditorDelUndoAct::Redo()()
206 sal_uLong nPos;
207 std::vector< std::shared_ptr<OTableRow> >* pOriginalRows = pTabEdCtrl->GetRowList();
208
209 for (auto const& deletedRow : m_aDeletedRows)
210 {
211 nPos = deletedRow->GetPos();
>>> CID 1427632: API usage errors (INVALIDATE_ITERATOR)
>>> Using invalid iterator "std::vector<std::shared_ptr<dbaui::OTableRow>, std::allocator<std::shared_ptr<dbaui::OTableRow> > >::const_iterator(pOriginalRows->begin() + nPos)".
212 pOriginalRows->erase( pOriginalRows->begin()+nPos );
213 }
214
215 pTabEdCtrl->DisplayData(pTabEdCtrl->GetCurRow());
216 pTabEdCtrl->Invalidate();
217 OTableEditorUndoAct::Redo();
** CID 1427631: (DEADCODE)
/sfx2/source/dialog/filedlghelper.cxx: 2699 in sfx2::RequestPassword(const std::shared_ptr<const SfxFilter> &, const rtl::OUString &, SfxItemSet *)()
/sfx2/source/dialog/filedlghelper.cxx: 2736 in sfx2::RequestPassword(const std::shared_ptr<const SfxFilter> &, const rtl::OUString &, SfxItemSet *)()
________________________________________________________________________________________________________
*** CID 1427631: (DEADCODE)
/sfx2/source/dialog/filedlghelper.cxx: 2699 in sfx2::RequestPassword(const std::shared_ptr<const SfxFilter> &, const rtl::OUString &, SfxItemSet *)()
2693 if ( pPasswordRequest->getPassword().getLength() )
2694 {
2695 // TODO/LATER: The filters should show the password dialog themself in future
2696 if ( bMSType )
2697 {
2698 // Check if filter supports OOXML encryption
>>> CID 1427631: (DEADCODE)
>>> Execution cannot reach this statement: "if (sfx2::<unnamed>::lclSup...".
2699 if ( lclSupportsOOXMLEncryption( pCurrentFilter->GetFilterName() ) )
2700 {
2701 ::comphelper::SequenceAsHashMap aHashData;
2702 aHashData[ OUString( "OOXPassword" ) ] <<= pPasswordRequest->getPassword();
2703 pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aHashData.getAsConstNamedValueList() ) ) );
2704 }
/sfx2/source/dialog/filedlghelper.cxx: 2736 in sfx2::RequestPassword(const std::shared_ptr<const SfxFilter> &, const rtl::OUString &, SfxItemSet *)()
2730 if ( pPasswordRequest->getRecommendReadOnly() )
2731 pSet->Put( SfxBoolItem( SID_RECOMMENDREADONLY, true ) );
2732
2733 if ( bMSType )
2734 {
2735 // the empty password has 0 as Hash
>>> CID 1427631: (DEADCODE)
>>> Execution cannot reach this statement: "nHash = SfxMedium::CreatePa...".
2736 sal_Int32 nHash = SfxMedium::CreatePasswordToModifyHash( pPasswordRequest->getPasswordToModify(),
2737 pCurrentFilter->GetServiceName() == "com.sun.star.text.TextDocument" );
2738 if ( nHash )
2739 pSet->Put( SfxUnoAnyItem( SID_MODIFYPASSWORDINFO, uno::makeAny( nHash ) ) );
2740 }
2741 else
** CID 1427630: (CHECKED_RETURN)
/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx: 428 in XMLSignature_GpgImpl::validate(const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSignatureTemplate> &, const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> &)()
/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx: 429 in XMLSignature_GpgImpl::validate(const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSignatureTemplate> &, const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> &)()
________________________________________________________________________________________________________
*** CID 1427630: (CHECKED_RETURN)
/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx: 428 in XMLSignature_GpgImpl::validate(const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSignatureTemplate> &, const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> &)()
422 nKeyLen, false);
423
424 GpgME::ImportResult import_res=rCtx.importKeys(data_key);
425 xmlFree(pKeyPacket);
426
427 // and re-run (rewind text and signature streams to position 0)
>>> CID 1427630: (CHECKED_RETURN)
>>> Calling "seek" without checking return value (as is done elsewhere 8 out of 10 times).
428 data_text.seek(0,SEEK_SET);
429 data_signature.seek(0,SEEK_SET);
430 verify_res=rCtx.verifyDetachedSignature(data_signature, data_text);
431
432 // TODO: needs some more error handling, needs checking _all_ signatures
433 if( verify_res.isNull() || verify_res.numSignatures() == 0
/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx: 429 in XMLSignature_GpgImpl::validate(const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSignatureTemplate> &, const com::sun::star::uno::Reference<com::sun::star::xml::crypto::XXMLSecurityContext> &)()
423
424 GpgME::ImportResult import_res=rCtx.importKeys(data_key);
425 xmlFree(pKeyPacket);
426
427 // and re-run (rewind text and signature streams to position 0)
428 data_text.seek(0,SEEK_SET);
>>> CID 1427630: (CHECKED_RETURN)
>>> Calling "seek" without checking return value (as is done elsewhere 8 out of 10 times).
429 data_signature.seek(0,SEEK_SET);
430 verify_res=rCtx.verifyDetachedSignature(data_signature, data_text);
431
432 // TODO: needs some more error handling, needs checking _all_ signatures
433 if( verify_res.isNull() || verify_res.numSignatures() == 0
434 // there is at least 1 signature and it is anything else than valid
** CID 1427629: Error handling issues (CHECKED_RETURN)
/sw/source/filter/xml/xmlmeta.cxx: 152 in SwXMLImport::SetStatistics(const com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> &)()
________________________________________________________________________________________________________
*** CID 1427629: Error handling issues (CHECKED_RETURN)
/sw/source/filter/xml/xmlmeta.cxx: 152 in SwXMLImport::SetStatistics(const com::sun::star::uno::Sequence<com::sun::star::beans::NamedValue> &)()
146 // guesstimate PROGRESS_BAR_STEPS each for meta+settings, styles,
147 // and autostyles.
148 sal_Int32 nProgressReference = 250;
149 if( nTokens & XML_TOK_META_STAT_PARA )
150 nProgressReference = static_cast<sal_Int32>(aDocStat.nPara);
151 else if ( nTokens & XML_TOK_META_STAT_PAGE )
>>> CID 1427629: Error handling issues (CHECKED_RETURN)
>>> Calling "checked_multiply" without checking return value (as is done elsewhere 9 out of 11 times).
152 o3tl::checked_multiply<sal_Int32>(aDocStat.nPage, 10, nProgressReference);
153 ProgressBarHelper* pProgress = GetProgressBarHelper();
154 pProgress->SetReference( nProgressReference + 3*PROGRESS_BAR_STEP );
155 pProgress->SetValue( 0 );
156 }
157
** CID 1427628: Null pointer dereferences (REVERSE_INULL)
/sc/source/ui/view/tabvwsha.cxx: 562 in ScTabViewShell::ExecuteCellFormatDlg(SfxRequest &, const rtl::OString &)::[lambda(int) (instance 1)]::operator ()(int) const()
________________________________________________________________________________________________________
*** CID 1427628: Null pointer dereferences (REVERSE_INULL)
/sc/source/ui/view/tabvwsha.cxx: 562 in ScTabViewShell::ExecuteCellFormatDlg(SfxRequest &, const rtl::OString &)::[lambda(int) (instance 1)]::operator ()(int) const()
556 {
557 UpdateNumberFormatter(static_cast<const SvxNumberInfoItem&>(*pItem));
558 }
559
560 ApplyAttributes(pOutSet, pOldSet.get());
561
>>> CID 1427628: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "pOutSet" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
562 pRequest->Done(pOutSet);
563 }
564 }, pDlg);
565 }
566
567 bool ScTabViewShell::IsRefInputMode() const
** CID 1427627: Possible Control flow issues (DEADCODE)
/vcl/source/uitest/uiobject.cxx: 713 in MultiLineEditUIObject::execute(const rtl::OUString &, const std::map<const rtl::OUString, rtl::OUString, std::less<const rtl::OUString>, std::allocator<std::pair<const rtl::OUString, rtl::OUString>>> &)()
________________________________________________________________________________________________________
*** CID 1427627: Possible Control flow issues (DEADCODE)
/vcl/source/uitest/uiobject.cxx: 713 in MultiLineEditUIObject::execute(const rtl::OUString &, const std::map<const rtl::OUString, rtl::OUString, std::less<const rtl::OUString>, std::allocator<std::pair<const rtl::OUString, rtl::OUString>>> &)()
707 Selection aSelection(nMin, nMax);
708 mxEdit->SetSelection(aSelection);
709 }
710 }
711
712 if (!bHandled)
>>> CID 1427627: Possible Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "this->WindowUIObject::execu...".
713 WindowUIObject::execute(rAction, rParameters);
714 }
715
716 StringMap MultiLineEditUIObject::get_state()
717 {
718 StringMap aMap = WindowUIObject::get_state();
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBnDJeNb0HijxaS4JNJPxk3kpyAm2AYqo71yXmnOxB72ibeUH-2F-2F1Lhi9AZq3dRu-2F4-3D_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpypQI5MZ4vVkJeOE2k78axAAw0k2z9qnvehJDykjhs7f19QaAcs05lDd-2FIV4WGmcbMK922vzgjlPj3F32k-2BUR2tpd3alu93QmR2nnoHUHVZnKXsR429w1HW7Ua5299ewFMldYBujwjNvad91jqQmPkOgnQH3yncVZ6Q7tkZ0s1ttE-3D
To manage Coverity Scan email notifications for "libreoffice at lists.freedesktop.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4k1FZJSDV-2FTHi5VQof9xGafB4oBwGYxuHHknceo2QLpCrZ44Ciy7AqBR2QyX6OCB5lwWgMDuK-2FivqaohkU3M9kT-2Fww10Qt2GoaCJAOQCa0Wv4ijH4oV8jCt0XXa7QeAwh_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpypQI5MZ4vVkJeOE2k78axAJwAMALaKfNnD4Rvq8K6alYUk6vmdncVibljlFhsKR9ZAhYr-2F6xRJbIjnValxS3qBX68SNPLgg41h8gwLbyq4yi4WKynOBaXfG8h8BVVgprISo-2FbPgOMUPi4BfWqL2hci18WGUOI5nIGK5DzacJO7co-3D
More information about the LibreOffice
mailing list