New Defects reported by Coverity Scan for LibreOffice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

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

10 new defect(s) introduced to LibreOffice found with Coverity Scan.
1 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 10 of 10 defect(s)


** CID 1538313:  Null pointer dereferences  (NULL_RETURNS)


________________________________________________________________________________________________________
*** CID 1538313:  Null pointer dereferences  (NULL_RETURNS)
/sc/source/core/data/documen3.cxx: 725 in ScDocument::SetCalcNotification(short)()
719         return false;
720     }
721     
722     void ScDocument::SetCalcNotification( SCTAB nTab )
723     {
724         // set only if not set before
>>>     CID 1538313:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" "pTable" when calling "GetCalcNotification".
725         if (ScTable* pTable = FetchTable(nTab) ; !pTable->GetCalcNotification())
726             pTable->SetCalcNotification(true);
727     }
728     
729     void ScDocument::ResetCalcNotifications()
730     {

** CID 1538312:  Null pointer dereferences  (NULL_RETURNS)


________________________________________________________________________________________________________
*** CID 1538312:  Null pointer dereferences  (NULL_RETURNS)
/sc/source/core/data/documen3.cxx: 472 in ScDocument::GetScenarioData(short, rtl::OUString &, Color &, ScScenarioFlags &) const()
466         return true;
467     }
468     
469     void ScDocument::GetScenarioData( SCTAB nTab, OUString& rComment,
470                                             Color& rColor, ScScenarioFlags& rFlags ) const
471     {
>>>     CID 1538312:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" "pTable" when calling "IsScenario".
472         if (const ScTable* pTable = FetchTable(nTab); pTable->IsScenario())
473         {
474             pTable->GetScenarioComment( rComment );
475             rColor = pTable->GetScenarioColor();
476             rFlags = pTable->GetScenarioFlags();
477         }

** CID 1538311:  Null pointer dereferences  (NULL_RETURNS)


________________________________________________________________________________________________________
*** CID 1538311:  Null pointer dereferences  (NULL_RETURNS)
/sc/source/core/data/documen3.cxx: 441 in ScDocument::SetScenarioData(short, const rtl::OUString &, const Color &, ScScenarioFlags)()
435         return pTable && pTable->IsScenario();
436     }
437     
438     void ScDocument::SetScenarioData( SCTAB nTab, const OUString& rComment,
439                                             const Color& rColor, ScScenarioFlags nFlags )
440     {
>>>     CID 1538311:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" "pTable" when calling "IsScenario".
441         if (ScTable* pTable = FetchTable(nTab); pTable->IsScenario())
442         {
443             pTable->SetScenarioComment( rComment );
444             pTable->SetScenarioColor( rColor );
445             pTable->SetScenarioFlags( nFlags );
446         }

** CID 1538310:  Incorrect expression  (USELESS_CALL)


________________________________________________________________________________________________________
*** CID 1538310:  Incorrect expression  (USELESS_CALL)
/sc/source/core/data/documen3.cxx: 664 in ScDocument::GetSheetEvents(short) const()
658         return *mxFormulaParserPool;
659     }
660     
661     const ScSheetEvents* ScDocument::GetSheetEvents( SCTAB nTab ) const
662     {
663         if (const ScTable* pTable = FetchTable(nTab))
>>>     CID 1538310:  Incorrect expression  (USELESS_CALL)
>>>     Calling "pTable->GetSheetEvents()" is only useful for its return value, which is ignored.
664             pTable->GetSheetEvents();
665         return nullptr;
666     }
667     
668     void ScDocument::SetSheetEvents( SCTAB nTab, std::unique_ptr<ScSheetEvents> pNew )
669     {

** CID 1538309:    (PASS_BY_VALUE)
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<vcl::PDFWriter::StructElement, const char *, (unsigned long)38, std::less<vcl::PDFWriter::StructElement>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructElement, const char *>, (unsigned long)38>, const std::less<vcl::PDFWriter::StructElement> &)()
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<vcl::PDFWriter::StructAttribute, const char *, (unsigned long)23, std::less<vcl::PDFWriter::StructAttribute>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttribute, const char *>, (unsigned long)23>, const std::less<vcl::PDFWriter::StructAttribute> &)()
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<int, int, (unsigned long)20, std::less<int>>::map(frozen::bits::carray<std::pair<int, int>, (unsigned long)20>, const std::less<int> &)()
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<vcl::PDFWriter::StructAttributeValue, const char *, (unsigned long)40, std::less<vcl::PDFWriter::StructAttributeValue>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttributeValue, const char *>, (unsigned long)40>, const std::less<vcl::PDFWriter::StructAttributeValue> &)()


________________________________________________________________________________________________________
*** CID 1538309:    (PASS_BY_VALUE)
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<vcl::PDFWriter::StructElement, const char *, (unsigned long)38, std::less<vcl::PDFWriter::StructElement>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructElement, const char *>, (unsigned long)38>, const std::less<vcl::PDFWriter::StructElement> &)()
91       using reverse_iterator = typename container_type::reverse_iterator;
92       using const_reverse_iterator =
93           typename container_type::const_reverse_iterator;
94     
95     public:
96       /* constructors */
>>>     CID 1538309:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<vcl::PDFWriter::StructElement, char const *, 38ul, std::less<vcl::PDFWriter::StructElement> >::container_type" (size 608 bytes) by value, which exceeds the high threshold of 512 bytes.
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<vcl::PDFWriter::StructAttribute, const char *, (unsigned long)23, std::less<vcl::PDFWriter::StructAttribute>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttribute, const char *>, (unsigned long)23>, const std::less<vcl::PDFWriter::StructAttribute> &)()
91       using reverse_iterator = typename container_type::reverse_iterator;
92       using const_reverse_iterator =
93           typename container_type::const_reverse_iterator;
94     
95     public:
96       /* constructors */
>>>     CID 1538309:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<vcl::PDFWriter::StructAttribute, char const *, 23ul, std::less<vcl::PDFWriter::StructAttribute> >::container_type" (size 368 bytes) by value, which exceeds the medium threshold of 256 bytes.
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<int, int, (unsigned long)20, std::less<int>>::map(frozen::bits::carray<std::pair<int, int>, (unsigned long)20>, const std::less<int> &)()
91       using reverse_iterator = typename container_type::reverse_iterator;
92       using const_reverse_iterator =
93           typename container_type::const_reverse_iterator;
94     
95     public:
96       /* constructors */
>>>     CID 1538309:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<int, int, 20ul, std::less<int> >::container_type" (size 160 bytes) by value, which exceeds the low threshold of 128 bytes.
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 97 in frozen::map<vcl::PDFWriter::StructAttributeValue, const char *, (unsigned long)40, std::less<vcl::PDFWriter::StructAttributeValue>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttributeValue, const char *>, (unsigned long)40>, const std::less<vcl::PDFWriter::StructAttributeValue> &)()
91       using reverse_iterator = typename container_type::reverse_iterator;
92       using const_reverse_iterator =
93           typename container_type::const_reverse_iterator;
94     
95     public:
96       /* constructors */
>>>     CID 1538309:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<vcl::PDFWriter::StructAttributeValue, char const *, 40ul, std::less<vcl::PDFWriter::StructAttributeValue> >::container_type" (size 640 bytes) by value, which exceeds the high threshold of 512 bytes.
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}

** CID 1538308:  Error handling issues  (UNCAUGHT_EXCEPT)
/sd/source/ui/unoidl/unomodel.cxx: 3511 in SdDocLinkTargetType::SdDocLinkTargetType(SdXImpressDocument *, unsigned short)()


________________________________________________________________________________________________________
*** CID 1538308:  Error handling issues  (UNCAUGHT_EXCEPT)
/sd/source/ui/unoidl/unomodel.cxx: 3511 in SdDocLinkTargetType::SdDocLinkTargetType(SdXImpressDocument *, unsigned short)()
3505     
3506     uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getSupportedServiceNames()
3507     {
3508         return { "com.sun.star.document.LinkTargets" };
3509     }
3510     
>>>     CID 1538308:  Error handling issues  (UNCAUGHT_EXCEPT)
>>>     An exception of type "com::sun::star::uno::RuntimeException" is thrown but the exception specification "noexcept" doesn't allow it to be thrown. This will result in a call to terminate().
3511     SdDocLinkTargetType::SdDocLinkTargetType(SdXImpressDocument* pModel, sal_uInt16 nT) noexcept
3512         : mpModel(pModel)
3513         , mnType(nT)
3514     {
3515         maName = SdResId(aTypeResIds[nT]);
3516     }

** CID 1538307:  Uninitialized variables  (UNINIT)


________________________________________________________________________________________________________
*** CID 1538307:  Uninitialized variables  (UNINIT)
/sc/source/ui/theme/ThemeColorChanger.cxx: 217 in sc::<unnamed>::changeSheets(ScDocShell &, ScDrawLayer *, const std::shared_ptr<model::ColorSet> &)()
211                         ScEditDataArray* pDataArray = pUndo->GetDataArray();
212     
213                         rDocument.ApplySelectionPattern(aNewPattern, aMark, pDataArray);
214     
215                         rDocShell.GetUndoManager()->AddUndoAction(std::move(pUndo));
216                     }
>>>     CID 1538307:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "aNewPattern.pName._M_payload._M_payload" when calling "~ScPatternAttr".
217                 }
218             }
219     
220             // Change all SdrObjects
221             {
222                 pModel->BeginCalcUndo(true);

** CID 1538306:  Error handling issues  (UNCAUGHT_EXCEPT)
/sd/source/ui/unoidl/unomodel.cxx: 3394 in SdDocLinkTargets::SdDocLinkTargets(SdXImpressDocument &)()


________________________________________________________________________________________________________
*** CID 1538306:  Error handling issues  (UNCAUGHT_EXCEPT)
/sd/source/ui/unoidl/unomodel.cxx: 3394 in SdDocLinkTargets::SdDocLinkTargets(SdXImpressDocument &)()
3388     uno::Sequence< OUString > SAL_CALL SdMasterPagesAccess::getSupportedServiceNames(  )
3389     {
3390         return { "com.sun.star.drawing.MasterPages" };
3391     }
3392     
3393     
>>>     CID 1538306:  Error handling issues  (UNCAUGHT_EXCEPT)
>>>     An exception of type "com::sun::star::uno::RuntimeException" is thrown but the exception specification "noexcept" doesn't allow it to be thrown. This will result in a call to terminate().
3394     SdDocLinkTargets::SdDocLinkTargets( SdXImpressDocument& rMyModel ) noexcept
3395     : mpModel( &rMyModel )
3396     {
3397         for (sal_uInt16 i=0; i < SdLinkTargetType::Count; i++)
3398             aNames[i] = SdResId(aTypeResIds[i]);
3399     }

** CID 1538305:  Null pointer dereferences  (NULL_RETURNS)


________________________________________________________________________________________________________
*** CID 1538305:  Null pointer dereferences  (NULL_RETURNS)
/sc/source/core/data/documen3.cxx: 482 in ScDocument::GetScenarioFlags(short, ScScenarioFlags &) const()
476             rFlags = pTable->GetScenarioFlags();
477         }
478     }
479     
480     void ScDocument::GetScenarioFlags( SCTAB nTab, ScScenarioFlags& rFlags ) const
481     {
>>>     CID 1538305:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" "pTable" when calling "IsScenario".
482         if (const ScTable* pTable = FetchTable(nTab); pTable->IsScenario())
483             rFlags = pTable->GetScenarioFlags();
484     }
485     
486     bool ScDocument::IsLinked( SCTAB nTab ) const
487     {

** CID 1538304:    (PASS_BY_VALUE)
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<vcl::PDFWriter::StructAttribute, const char *, (unsigned long)23, std::less<vcl::PDFWriter::StructAttribute>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttribute, const char *>, (unsigned long)23>)()
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<vcl::PDFWriter::StructElement, const char *, (unsigned long)38, std::less<vcl::PDFWriter::StructElement>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructElement, const char *>, (unsigned long)38>)()
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<vcl::PDFWriter::StructAttributeValue, const char *, (unsigned long)40, std::less<vcl::PDFWriter::StructAttributeValue>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttributeValue, const char *>, (unsigned long)40>)()
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<int, int, (unsigned long)20, std::less<int>>::map(frozen::bits::carray<std::pair<int, int>, (unsigned long)20>)()


________________________________________________________________________________________________________
*** CID 1538304:    (PASS_BY_VALUE)
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<vcl::PDFWriter::StructAttribute, const char *, (unsigned long)23, std::less<vcl::PDFWriter::StructAttribute>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttribute, const char *>, (unsigned long)23>)()
95     public:
96       /* constructors */
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
>>>     CID 1538304:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<vcl::PDFWriter::StructAttribute, char const *, 23ul, std::less<vcl::PDFWriter::StructAttribute> >::container_type" (size 368 bytes) by value, which exceeds the medium threshold of 256 bytes.
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}
103     
104       constexpr map(std::initializer_list<value_type> items, Compare const &compare)
105           : map{container_type {items}, compare} {
106             constexpr_assert(items.size() == N, "Inconsistent initializer_list size and type size argument");
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<vcl::PDFWriter::StructElement, const char *, (unsigned long)38, std::less<vcl::PDFWriter::StructElement>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructElement, const char *>, (unsigned long)38>)()
95     public:
96       /* constructors */
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
>>>     CID 1538304:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<vcl::PDFWriter::StructElement, char const *, 38ul, std::less<vcl::PDFWriter::StructElement> >::container_type" (size 608 bytes) by value, which exceeds the high threshold of 512 bytes.
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}
103     
104       constexpr map(std::initializer_list<value_type> items, Compare const &compare)
105           : map{container_type {items}, compare} {
106             constexpr_assert(items.size() == N, "Inconsistent initializer_list size and type size argument");
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<vcl::PDFWriter::StructAttributeValue, const char *, (unsigned long)40, std::less<vcl::PDFWriter::StructAttributeValue>>::map(frozen::bits::carray<std::pair<vcl::PDFWriter::StructAttributeValue, const char *>, (unsigned long)40>)()
95     public:
96       /* constructors */
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
>>>     CID 1538304:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<vcl::PDFWriter::StructAttributeValue, char const *, 40ul, std::less<vcl::PDFWriter::StructAttributeValue> >::container_type" (size 640 bytes) by value, which exceeds the high threshold of 512 bytes.
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}
103     
104       constexpr map(std::initializer_list<value_type> items, Compare const &compare)
105           : map{container_type {items}, compare} {
106             constexpr_assert(items.size() == N, "Inconsistent initializer_list size and type size argument");
/workdir/UnpackedTarball/frozen/include/frozen/map.h: 101 in frozen::map<int, int, (unsigned long)20, std::less<int>>::map(frozen::bits::carray<std::pair<int, int>, (unsigned long)20>)()
95     public:
96       /* constructors */
97       constexpr map(container_type items, Compare const &compare)
98           : less_than_{compare}
99           , items_{bits::quicksort(items, less_than_)} {}
100     
>>>     CID 1538304:    (PASS_BY_VALUE)
>>>     Passing parameter items of type "frozen::map<int, int, 20ul, std::less<int> >::container_type" (size 160 bytes) by value, which exceeds the low threshold of 128 bytes.
101       explicit constexpr map(container_type items)
102           : map{items, Compare{}} {}
103     
104       constexpr map(std::initializer_list<value_type> items, Compare const &compare)
105           : map{container_type {items}, compare} {
106             constexpr_assert(items.size() == N, "Inconsistent initializer_list size and type size argument");


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3D2zwM_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJidhBkUth1v0BFX1xnWL43-2BLU6jWt5gXg6-2FFDY7s-2F2bTK38J8D9VJXsfHaIfDT09gq0cCOuAK-2B035Xb8PE5B1MnzeYFe6QTFuBfy-2BH53IEvVjB88OmNMwVh9R4ogOOSqHZ1DqHk6bqjBpEll2KmDslwx9o8-2F6c5EQ0NVxqcw-2B7VQ0-3D




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux