New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Sat May 19 19:58:34 UTC 2018


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.
6 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 1435686:  Incorrect expression  (COPY_PASTE_ERROR)
/svx/source/xoutdev/_xoutbmp.cxx: 594 in XOutBitmap::GetContour(const Bitmap &, XOutFlags, const tools::Rectangle *)()


________________________________________________________________________________________________________
*** CID 1435686:  Incorrect expression  (COPY_PASTE_ERROR)
/svx/source/xoutdev/_xoutbmp.cxx: 594 in XOutBitmap::GetContour(const Bitmap &, XOutFlags, const tools::Rectangle *)()
588                                 pPoints1[ nPolyPos ] = Point( nX, nY );
589                                 nY = nStartY2;
590     
591                                 // this loop always breaks eventually as there is at least one pixel
592                                 while( true )
593                                 {
>>>     CID 1435686:  Incorrect expression  (COPY_PASTE_ERROR)
>>>     "nX" in "pAcc->GetPixelFromData(pScanline, nX)" looks like a copy-paste error.
594                                     if( aBlack == pAcc->GetPixelFromData( pScanline, nX ) )
595                                     {
596                                         pPoints2[ nPolyPos ] = Point( nX, nY );
597                                         break;
598                                     }
599     

** CID 1435685:    (CHECKED_RETURN)
/basegfx/test/genericclipper.cxx: 136 in basegfx2d::genericclipper::validateCrossover(const char *, const char *, const char *) const()
/basegfx/test/genericclipper.cxx: 137 in basegfx2d::genericclipper::validateCrossover(const char *, const char *, const char *) const()


________________________________________________________________________________________________________
*** CID 1435685:    (CHECKED_RETURN)
/basegfx/test/genericclipper.cxx: 136 in basegfx2d::genericclipper::validateCrossover(const char *, const char *, const char *) const()
130                                const char* pValidSvgD) const
131         {
132             OUString aInput=OUString::createFromAscii(pInputSvgD);
133             OUString aValid=OUString::createFromAscii(pValidSvgD);
134             B2DPolyPolygon aInputPoly, aValidPoly;
135     
>>>     CID 1435685:    (CHECKED_RETURN)
>>>     Calling "importFromSvgD" without checking return value (as is done elsewhere 20 out of 25 times).
136             utils::importFromSvgD(aInputPoly, aInput, false, nullptr);
137             utils::importFromSvgD(aValidPoly, aValid, false, nullptr);
138     
139             CPPUNIT_ASSERT_EQUAL_MESSAGE(
140                 pName,
141                 aValid,
/basegfx/test/genericclipper.cxx: 137 in basegfx2d::genericclipper::validateCrossover(const char *, const char *, const char *) const()
131         {
132             OUString aInput=OUString::createFromAscii(pInputSvgD);
133             OUString aValid=OUString::createFromAscii(pValidSvgD);
134             B2DPolyPolygon aInputPoly, aValidPoly;
135     
136             utils::importFromSvgD(aInputPoly, aInput, false, nullptr);
>>>     CID 1435685:    (CHECKED_RETURN)
>>>     Calling "importFromSvgD" without checking return value (as is done elsewhere 20 out of 25 times).
137             utils::importFromSvgD(aValidPoly, aValid, false, nullptr);
138     
139             CPPUNIT_ASSERT_EQUAL_MESSAGE(
140                 pName,
141                 aValid,
142                 basegfx::utils::exportToSvgD(

** CID 1435684:  Possible Control flow issues  (DEADCODE)
/cui/source/dialogs/SignSignatureLineDialog.cxx: 155 in SignSignatureLineDialog::Apply()()


________________________________________________________________________________________________________
*** CID 1435684:  Possible Control flow issues  (DEADCODE)
/cui/source/dialogs/SignSignatureLineDialog.cxx: 155 in SignSignatureLineDialog::Apply()()
149     
150         bool bSuccess = false; // TODO
151     
152         if (bSuccess)
153         {
154             // Read svg and replace placeholder texts
>>>     CID 1435684:  Possible Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "aSvgImage = this->getSignat...".
155             OUString aSvgImage(getSignatureImage());
156             aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", getCDataString(m_aSuggestedSignerName));
157             aSvgImage = aSvgImage.replaceAll("[SIGNER_TITLE]", getCDataString(m_aSuggestedSignerTitle));
158     
159             aSvgImage = aSvgImage.replaceAll("[SIGNATURE]", getCDataString(m_xEditName->get_text()));
160             OUString aIssuerLine = CuiResId(RID_SVXSTR_SIGNATURELINE_SIGNED_BY)

** CID 1435683:  Error handling issues  (CHECKED_RETURN)
/basegfx/test/clipstate.cxx: 138 in basegfx2d::clipstate::verifyMixedClips()()


________________________________________________________________________________________________________
*** CID 1435683:  Error handling issues  (CHECKED_RETURN)
/basegfx/test/clipstate.cxx: 138 in basegfx2d::clipstate::verifyMixedClips()()
132         {
133             utils::B2DClipState aMixedClip;
134     
135             const char unionSvg[]="m100 10v90h-90v10h-20v-10h-90v-90h-10v-20h10v-90h90v-10h20v10h90v90h10v20z";
136     
137             B2DPolyPolygon aTmp1;
>>>     CID 1435683:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "importFromSvgD" without checking return value (as is done elsewhere 20 out of 25 times).
138             utils::importFromSvgD(aTmp1, unionSvg, false, nullptr);
139     
140             aMixedClip.intersectPolyPolygon(aTmp1);
141             aMixedClip.subtractRange(B2DRange(-20,-150,20,0));
142             aMixedClip.subtractRange(B2DRange(-150,-20,0,20));
143             aMixedClip.xorRange(B2DRange(-150,-150,150,150));

** CID 1435682:  Error handling issues  (CHECKED_RETURN)
/basegfx/test/boxclipper.cxx: 164 in basegfx2d::boxclipper::setUp()()


________________________________________________________________________________________________________
*** CID 1435682:  Error handling issues  (CHECKED_RETURN)
/basegfx/test/boxclipper.cxx: 164 in basegfx2d::boxclipper::setUp()()
158     
159                 aRandomIntersections.appendElement( aRandomRange, B2VectorOrientation::Negative );
160             }
161     #else
162             const char randomSvg[]="m394 783h404v57h-404zm-197-505h571v576h-571zm356-634h75v200h-75zm-40-113h403v588h-403zm93-811h111v494h-111zm-364-619h562v121h-562zm-134-8h292v27h-292zm110 356h621v486h-621zm78-386h228v25h-228zm475-345h201v201h-201zm-2-93h122v126h-122zm-417-243h567v524h-567zm-266-738h863v456h-863zm262-333h315v698h-315zm-328-826h43v393h-43zm830-219h120v664h-120zm-311-636h221v109h-221zm-500 137h628v19h-628zm681-94h211v493h-211zm-366-646h384v355h-384zm-189-199h715v247h-715zm165-459h563v601h-563zm258-479h98v606h-98zm270-517h65v218h-65zm-44-259h96v286h-96zm-599-202h705v468h-705zm216-803h450v494h-450zm-150-22h26v167h-26zm-55-599h50v260h-50zm190-278h490v387h-490zm-290-453h634v392h-634zm257 189h552v300h-552zm-151-690h136v455h-136zm12-597h488v432h-488zm501-459h48v39h-48zm-224-112h429v22h-429zm-281 102h492v621h-492zm519-158h208v17h-208zm-681-563h56v427h-56zm126-451h615v392h-615zm-47-410h598v522h-598zm-32 316h79v110h-79zm-71-129h18v127h-18zm126-993h743v589h-743zm211-430h428v750h-428zm61-554h100v220h-100zm-353-49h658v157h-658zm778-383h115v272h-115zm-249-541h119v712h-119zm203 86h94v40h-94z";
163             B2DPolyPolygon randomPoly;
>>>     CID 1435682:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "importFromSvgD" without checking return value (as is done elsewhere 20 out of 25 times).
164             utils::importFromSvgD(randomPoly, randomSvg, false, nullptr);
165             for (auto const& aPolygon : randomPoly)
166                 aRandomIntersections.appendElement(aPolygon.getB2DRange(), B2VectorOrientation::Negative);
167     #endif
168         }
169     

** CID 1435681:  Uninitialized members  (UNINIT_CTOR)
/sfx2/source/doc/objxtor.cxx: 284 in SfxObjectShell::SfxObjectShell(SfxModelFlags)()


________________________________________________________________________________________________________
*** CID 1435681:  Uninitialized members  (UNINIT_CTOR)
/sfx2/source/doc/objxtor.cxx: 284 in SfxObjectShell::SfxObjectShell(SfxModelFlags)()
278         if ( !bScriptSupport )
279             pImpl->m_bNoBasicCapabilities = true;
280     
281         const bool bDocRecovery = ( i_nCreationFlags & SfxModelFlags::DISABLE_DOCUMENT_RECOVERY ) == SfxModelFlags::NONE;
282         if ( !bDocRecovery )
283             pImpl->m_bDocRecoverySupport = false;
>>>     CID 1435681:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "m_bAllowModifiedBackAfterSigning" is not initialized in this constructor nor in any functions that it calls.
284     }
285     
286     /** Constructor of the class SfxObjectShell.
287     
288         @param eMode Purpose, to which the SfxObjectShell is created:
289                      SfxObjectCreateMode::EMBEDDED (default) as SO-Server from within another Document

** CID 1435680:  Error handling issues  (CHECKED_RETURN)
/editeng/source/misc/svxacorr.cxx: 2652 in SvxAutocorrWordList::LoadEntry(const rtl::OUString &, const rtl::OUString &, bool)()


________________________________________________________________________________________________________
*** CID 1435680:  Error handling issues  (CHECKED_RETURN)
/editeng/source/misc/svxacorr.cxx: 2652 in SvxAutocorrWordList::LoadEntry(const rtl::OUString &, const rtl::OUString &, bool)()
2646             return mpImpl->maSet.insert( pWord.release() ).second;
2647     }
2648     
2649     void SvxAutocorrWordList::LoadEntry(const OUString& sWrong, const OUString& sRight, bool bOnlyTxt)
2650     {
2651         std::unique_ptr<SvxAutocorrWord> pNew(new SvxAutocorrWord( sWrong, sRight, bOnlyTxt ));
>>>     CID 1435680:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "Insert" without checking return value (as is done elsewhere 5 out of 6 times).
2652         Insert( std::move(pNew) );
2653     }
2654     
2655     bool SvxAutocorrWordList::empty() const
2656     {
2657         return mpImpl->maHash.empty() && mpImpl->maSet.empty();

** CID 1435679:  Uninitialized members  (UNINIT_CTOR)
/sfx2/source/doc/objxtor.cxx: 301 in SfxObjectShell::SfxObjectShell(SfxObjectCreateMode)()


________________________________________________________________________________________________________
*** CID 1435679:  Uninitialized members  (UNINIT_CTOR)
/sfx2/source/doc/objxtor.cxx: 301 in SfxObjectShell::SfxObjectShell(SfxObjectCreateMode)()
295         , pMedium(nullptr)
296         , eCreateMode(eMode)
297         , bHasName(false)
298         , bIsInGenerateThumbnail(false)
299         , mbAvoidRecentDocs(false)
300     {
>>>     CID 1435679:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "m_bAllowModifiedBackAfterSigning" is not initialized in this constructor nor in any functions that it calls.
301     }
302     
303     SfxObjectShell::~SfxObjectShell()
304     {
305     
306         if ( IsEnableSetModified() )

** CID 1435678:  Resource leaks  (RESOURCE_LEAK)
/sd/source/ui/view/viewshe2.cxx: 552 in sd::ViewShell::SetPageSizeAndBorder(PageKind, const Size &, long, long, long, long, bool, Orientation, unsigned short, bool)()


________________________________________________________________________________________________________
*** CID 1435678:  Resource leaks  (RESOURCE_LEAK)
/sd/source/ui/view/viewshe2.cxx: 552 in sd::ViewShell::SetPageSizeAndBorder(PageKind, const Size &, long, long, long, long, bool, Orientation, unsigned short, bool)()
546             pViewShell->GetViewFrame()->GetBindings().Invalidate(SID_RULER_NULL_OFFSET);
547             // zoom onto (new) page size
548             pViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_SIZE_PAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
549         }
550     
551         Broadcast(ViewShellHint(ViewShellHint::HINT_PAGE_RESIZE_END));
>>>     CID 1435678:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "pUndoGroup" going out of scope leaks the storage it points to.
552     }
553     
554     /**
555      * Set zoom factor for InPlace
556      */
557     void ViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction&)


________________________________________________________________________________________________________
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-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpySih174T-2FJAu6uZwvhVI1OSbhqNpvBc2lLpMJXS6ahiccu5sIQE6Dc7z73G1L2kCPlCgxo-2BnO0dbM-2FGMMyh4FYkWS-2FzPrVYkHnRrQRUR3bZRfLTk2b5k6MJVU8oCUDwAqJOyVj-2BatETEs7i8JyvXrdbFwRYddHbFYG6Nvv0-2FE514-3D



More information about the LibreOffice mailing list