New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Tue Aug 20 18:46:32 UTC 2019


Hi,

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

3 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 3 of 3 defect(s)


** CID 1452395:  API usage errors  (INVALIDATE_ITERATOR)
/vcl/source/uitest/logger.cxx: 352 in <unnamed>::GetKeyInMapWithIndex(const std::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, rtl::OUString>>> &, int)()


________________________________________________________________________________________________________
*** CID 1452395:  API usage errors  (INVALIDATE_ITERATOR)
/vcl/source/uitest/logger.cxx: 352 in <unnamed>::GetKeyInMapWithIndex(const std::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, rtl::OUString>>> &, int)()
346     
347         std::map<OUString, OUString>::const_iterator itr = rParameters.begin();
348     
349         for (; itr != rParameters.end() && j < index; ++itr, ++j)
350             ;
351     
>>>     CID 1452395:  API usage errors  (INVALIDATE_ITERATOR)
>>>     Dereferencing iterator "itr" though it is already past the end of its container.
352         return itr->first;
353     }
354     }
355     
356     void UITestLogger::logEvent(const EventDescription& rDescription)
357     {

** CID 1452394:  API usage errors  (INVALIDATE_ITERATOR)
/vcl/source/uitest/logger.cxx: 340 in <unnamed>::GetValueInMapWithIndex(const std::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, rtl::OUString>>> &, int)()


________________________________________________________________________________________________________
*** CID 1452394:  API usage errors  (INVALIDATE_ITERATOR)
/vcl/source/uitest/logger.cxx: 340 in <unnamed>::GetValueInMapWithIndex(const std::map<rtl::OUString, rtl::OUString, std::less<rtl::OUString>, std::allocator<std::pair<const rtl::OUString, rtl::OUString>>> &, int)()
334     
335         std::map<OUString, OUString>::const_iterator itr = rParameters.begin();
336     
337         for (; itr != rParameters.end() && j < index; ++itr, ++j)
338             ;
339     
>>>     CID 1452394:  API usage errors  (INVALIDATE_ITERATOR)
>>>     Dereferencing iterator "itr" though it is already past the end of its container.
340         return itr->second;
341     }
342     
343     OUString GetKeyInMapWithIndex(const std::map<OUString, OUString>& rParameters, sal_Int32 index)
344     {
345         sal_Int32 j = 0;

** CID 1452393:    (INVALIDATE_ITERATOR)
/sc/source/core/data/dpoutput.cxx: 1178 in ScDPOutput::GetMemberResultNames(std::unordered_set<rtl::OUString, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<rtl::OUString>> &, long)()
/sc/source/core/data/dpoutput.cxx: 1178 in ScDPOutput::GetMemberResultNames(std::unordered_set<rtl::OUString, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<rtl::OUString>> &, long)()


________________________________________________________________________________________________________
*** CID 1452393:    (INVALIDATE_ITERATOR)
/sc/source/core/data/dpoutput.cxx: 1178 in ScDPOutput::GetMemberResultNames(std::unordered_set<rtl::OUString, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<rtl::OUString>> &, long)()
1172         }
1173     
1174         // collect the member names
1175     
1176         if ( bFound )
1177         {
>>>     CID 1452393:    (INVALIDATE_ITERATOR)
>>>     Dereferencing iterator "it" though it is already past the end of its container.
1178             const uno::Sequence<sheet::MemberResult> aMemberResults = it->maResult;
1179             for (const sheet::MemberResult& rMemberResult : aMemberResults)
1180             {
1181                 if ( rMemberResult.Flags & sheet::MemberResultFlags::HASMEMBER )
1182                     rNames.insert(rMemberResult.Name);
1183             }
/sc/source/core/data/dpoutput.cxx: 1178 in ScDPOutput::GetMemberResultNames(std::unordered_set<rtl::OUString, std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, std::allocator<rtl::OUString>> &, long)()
1172         }
1173     
1174         // collect the member names
1175     
1176         if ( bFound )
1177         {
>>>     CID 1452393:    (INVALIDATE_ITERATOR)
>>>     Dereferencing iterator "it" though it is already past the end of its container.
1178             const uno::Sequence<sheet::MemberResult> aMemberResults = it->maResult;
1179             for (const sheet::MemberResult& rMemberResult : aMemberResults)
1180             {
1181                 if ( rMemberResult.Flags & sheet::MemberResultFlags::HASMEMBER )
1182                     rNames.insert(rMemberResult.Name);
1183             }


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBnDJeNb0HijxaS4JNJPxk3kpyAm2AYqo71yXmnOxB73RtgzoPcQtNNP5dkHLuV1E-3D_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpydN1LOlpVCvYEuj-2BPLWY9abIX-2FyCec9UuTsK-2BfR9pq7EFfwJps0ZlaR8rcaIyfWkFfI4LZUqzcwQF7kJAmTgMu54DdkXHFJaeVouFcA5G1wavBru1P4TO2vyARVjWVRjF4rfqqHunOOHdB5FszraR1ZLyxh9g-2FsKp53pmj1q4pm0-3D



More information about the LibreOffice mailing list