New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Sat Jul 4 09:05:22 PDT 2015
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
9 new defect(s) introduced to LibreOffice found with Coverity Scan.
23 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 9 of 9 defect(s)
** CID 1309267: Error handling issues (UNCAUGHT_EXCEPT)
/sc/source/ui/vba/vbaeventshelper.cxx: 852 in ScVbaEventsHelper::createWorksheet(const com::sun::star::uno::Sequence<com::sun::star::uno::Any> &, int) const()
________________________________________________________________________________________________________
*** CID 1309267: Error handling issues (UNCAUGHT_EXCEPT)
/sc/source/ui/vba/vbaeventshelper.cxx: 852 in ScVbaEventsHelper::createWorksheet(const com::sun::star::uno::Sequence<com::sun::star::uno::Any> &, int) const()
846 ScCellRangesBase* pNewCellRanges = ScCellRangesBase::getImplementation( xNewSelection );
847 bool bChanged = !pOldCellRanges || !pNewCellRanges || lclSelectionChanged( pOldCellRanges->GetRangeList(), pNewCellRanges->GetRangeList() );
848 maOldSelection <<= xNewSelection;
849 return bChanged;
850 }
851
>>> CID 1309267: Error handling issues (UNCAUGHT_EXCEPT)
>>> An exception of type "std::length_error" is thrown but the throw list "throw(com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException)" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate().
852 uno::Any ScVbaEventsHelper::createWorksheet( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nIndex ) const
853 throw (lang::IllegalArgumentException, uno::RuntimeException)
854 {
855 // extract sheet index, will throw, if parameter is invalid
856 SCTAB nTab = lclGetTabFromArgs( rArgs, nIndex );
857 return uno::Any( excel::getUnoSheetModuleObj( mxModel, nTab ) );
** CID 1309266: Error handling issues (UNCAUGHT_EXCEPT)
/svx/source/accessibility/AccessibleControlShape.cxx: 608 in accessibility::AccessibleControlShape::CreateAccessibleName()()
________________________________________________________________________________________________________
*** CID 1309266: Error handling issues (UNCAUGHT_EXCEPT)
/svx/source/accessibility/AccessibleControlShape.cxx: 608 in accessibility::AccessibleControlShape::CreateAccessibleName()()
602 }
603 }
604 Reference< XAccessibleRelationSet > xSet = pRelationSetHelper;
605 return xSet;
606 }
607
>>> CID 1309266: Error handling issues (UNCAUGHT_EXCEPT)
>>> An exception of type "std::length_error" is thrown but the throw list "throw(com::sun::star::uno::RuntimeException)" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate().
608 OUString AccessibleControlShape::CreateAccessibleName() throw (RuntimeException)
609 {
610 ensureControlModelAccess();
611
612 OUString sName;
613 if ( getAccessibleRole() != AccessibleRole::SHAPE
** CID 1309265: Error handling issues (UNCAUGHT_EXCEPT)
/ucb/source/core/ucbcmds.cxx: 1684 in UniversalContentBroker::globalTransfer(const com::sun::star::ucb::GlobalTransferCommandArgument2 &, const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> &)()
________________________________________________________________________________________________________
*** CID 1309265: Error handling issues (UNCAUGHT_EXCEPT)
/ucb/source/core/ucbcmds.cxx: 1684 in UniversalContentBroker::globalTransfer(const com::sun::star::ucb::GlobalTransferCommandArgument2 &, const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> &)()
1678 UniversalContentBroker::getCommandInfo()
1679 {
1680 return uno::Reference< ucb::XCommandInfo >( new CommandProcessorInfo() );
1681 }
1682
1683
>>> CID 1309265: Error handling issues (UNCAUGHT_EXCEPT)
>>> An exception of type "std::length_error" is thrown but the throw list "throw(com::sun::star::uno::Exception)" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate().
1684 void UniversalContentBroker::globalTransfer(
1685 const ucb::GlobalTransferCommandArgument2 & rArg,
1686 const uno::Reference< ucb::XCommandEnvironment > & xEnv )
1687 throw( uno::Exception )
1688 {
1689 // Use own command environment with own interaction handler intercepting
** CID 1309264: Integer handling issues (REVERSE_NEGATIVE)
/oox/source/vml/vmlshape.cxx: 321 in oox::vml::ShapeBase::convertAndInsert(const com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> &, const oox::vml::ShapeParentAnchor *) const()
________________________________________________________________________________________________________
*** CID 1309264: Integer handling issues (REVERSE_NEGATIVE)
/oox/source/vml/vmlshape.cxx: 321 in oox::vml::ShapeBase::convertAndInsert(const com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> &, const oox::vml::ShapeParentAnchor *) const()
315
316 OUString sLinkChainName = getTypeModel().maLegacyId;
317 sal_Int32 id = 0;
318 sal_Int32 idPos = sLinkChainName.indexOf("_x");
319 sal_Int32 seq = 0;
320 sal_Int32 seqPos = sLinkChainName.indexOf("_s",idPos);
>>> CID 1309264: Integer handling issues (REVERSE_NEGATIVE)
>>> You might be using variable "idPos" before verifying that it is >= 0.
321 if( idPos >= 0 && idPos < seqPos )
322 {
323 id = sLinkChainName.copy(idPos+2,seqPos-idPos+2).toInt32();
324 seq = sLinkChainName.copy(seqPos+2).toInt32();
325 }
326
** CID 1309263: Integer handling issues (NEGATIVE_RETURNS)
/oox/source/vml/vmlshape.cxx: 318 in oox::vml::ShapeBase::convertAndInsert(const com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> &, const oox::vml::ShapeParentAnchor *) const()
________________________________________________________________________________________________________
*** CID 1309263: Integer handling issues (NEGATIVE_RETURNS)
/oox/source/vml/vmlshape.cxx: 318 in oox::vml::ShapeBase::convertAndInsert(const com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> &, const oox::vml::ShapeParentAnchor *) const()
312 if( aShapeProp.hasProperty( PROP_Name ) )
313 aShapeProp.setProperty( PROP_Name, getShapeName() );
314 uno::Reference< lang::XServiceInfo > xSInfo( xShape, uno::UNO_QUERY_THROW );
315
316 OUString sLinkChainName = getTypeModel().maLegacyId;
317 sal_Int32 id = 0;
>>> CID 1309263: Integer handling issues (NEGATIVE_RETURNS)
>>> Assigning: signed variable "idPos" = "indexOf".
318 sal_Int32 idPos = sLinkChainName.indexOf("_x");
319 sal_Int32 seq = 0;
320 sal_Int32 seqPos = sLinkChainName.indexOf("_s",idPos);
321 if( idPos >= 0 && idPos < seqPos )
322 {
323 id = sLinkChainName.copy(idPos+2,seqPos-idPos+2).toInt32();
** CID 1309262: Null pointer dereferences (FORWARD_NULL)
/sw/qa/extras/uiwriter/uiwriter.cxx: 1035 in SwUiWriterTest::testTdf69282()()
________________________________________________________________________________________________________
*** CID 1309262: Null pointer dereferences (FORWARD_NULL)
/sw/qa/extras/uiwriter/uiwriter.cxx: 1035 in SwUiWriterTest::testTdf69282()()
1029 aTempFile.EnableKillingFile();
1030 }
1031
1032 void SwUiWriterTest::testTdf69282()
1033 {
1034 mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
>>> CID 1309262: Null pointer dereferences (FORWARD_NULL)
>>> Assigning: "pTextDoc" = "dynamic_cast <SwXTextDocument *>(this->mxComponent.get())".
1035 SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
1036 SwDoc* source = pTextDoc->GetDocShell()->GetDoc();
1037 uno::Reference<lang::XComponent> xSourceDoc(mxComponent, uno::UNO_QUERY);
1038 mxComponent.clear();
1039 SwDoc* target = createDoc();
1040 SwPageDesc* sPageDesc = source->MakePageDesc(OUString("SourceStyle"));
** CID 1309261: Null pointer dereferences (FORWARD_NULL)
/svx/source/svdraw/sdrpaintwindow.cxx: 204 in SdrPaintWindow::impCreateOverlayManager()()
________________________________________________________________________________________________________
*** CID 1309261: Null pointer dereferences (FORWARD_NULL)
/svx/source/svdraw/sdrpaintwindow.cxx: 204 in SdrPaintWindow::impCreateOverlayManager()()
198 // not yet one created?
199 if(!mxOverlayManager.is())
200 {
201 // is it a window?
202 if(OUTDEV_WINDOW == GetOutputDevice().GetOutDevType())
203 {
>>> CID 1309261: Null pointer dereferences (FORWARD_NULL)
>>> Assigning: "pWindow" = "dynamic_cast <vcl::Window *>(this->GetOutputDevice())".
204 vcl::Window* pWindow = dynamic_cast<vcl::Window*>(&GetOutputDevice());
205 // decide which OverlayManager to use
206 if(GetPaintView().IsBufferedOverlayAllowed() && mbUseBuffer && !pWindow->SupportsDoubleBuffering())
207 {
208 // buffered OverlayManager, buffers its background and refreshes from there
209 // for pure overlay changes (no system redraw). The 3rd parameter specifies
** CID 1309260: Null pointer dereferences (FORWARD_NULL)
/sw/source/core/layout/fly.cxx: 1467 in CalcContent(SwLayoutFrm *, bool, bool)()
________________________________________________________________________________________________________
*** CID 1309260: Null pointer dereferences (FORWARD_NULL)
/sw/source/core/layout/fly.cxx: 1467 in CalcContent(SwLayoutFrm *, bool, bool)()
1461
1462 // OD 14.03.2003 #i11760# - forbid format of follow, if requested.
1463 if ( bNoCalcFollow && pFrm->IsTextFrm() )
1464 static_cast<SwTextFrm*>(pFrm)->ForbidFollowFormat();
1465
1466 const bool bDeleteForbidden(pSect && pSect->IsDeleteForbidden());
>>> CID 1309260: Null pointer dereferences (FORWARD_NULL)
>>> Comparing "pSect" to null implies that "pSect" might be null.
1467 if (pSect)
1468 pSect->ForbidDelete();
1469
1470 pFrm->Calc(pRenderContext);
1471
1472 if (!bDeleteForbidden)
** CID 1309259: Null pointer dereferences (FORWARD_NULL)
/sw/qa/extras/uiwriter/uiwriter.cxx: 1095 in SwUiWriterTest::testTdf69282WithMirror()()
________________________________________________________________________________________________________
*** CID 1309259: Null pointer dereferences (FORWARD_NULL)
/sw/qa/extras/uiwriter/uiwriter.cxx: 1095 in SwUiWriterTest::testTdf69282WithMirror()()
1089 xSourceDoc->dispose();
1090 }
1091
1092 void SwUiWriterTest::testTdf69282WithMirror()
1093 {
1094 mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
>>> CID 1309259: Null pointer dereferences (FORWARD_NULL)
>>> Assigning: "pTextDoc" = "dynamic_cast <SwXTextDocument *>(this->mxComponent.get())".
1095 SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
1096 SwDoc* source = pTextDoc->GetDocShell()->GetDoc();
1097 uno::Reference<lang::XComponent> xSourceDoc(mxComponent, uno::UNO_QUERY);
1098 mxComponent.clear();
1099 SwDoc* target = createDoc();
1100 SwPageDesc* sPageDesc = source->MakePageDesc(OUString("SourceStyle"));
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/211?tab=overview
To manage Coverity Scan email notifications for "libreoffice at lists.freedesktop.org", click https://scan.coverity.com/subscriptions/edit?email=libreoffice%40lists.freedesktop.org&token=d6481d718a775246b2340f282ebe5939
More information about the LibreOffice
mailing list