[Libreoffice-commits] core.git: ucb/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 18 10:01:25 UTC 2019


 ucb/source/ucp/file/filtask.cxx |   25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

New commits:
commit b6f452fcdf4dc206943fbe8d43822acb33cf1834
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 18 08:56:37 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jul 18 12:00:18 2019 +0200

    cid#1448431 Using invalid iterator
    
    if we are checking itnew against end in the first block, presumably
    the second block use of itnew needs the same guard
    
    Change-Id: Ia8cc45229024e477c00b2356665d5656d36f723b
    Reviewed-on: https://gerrit.libreoffice.org/75828
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index db1e4ca19dda..3c54c50b8ed4 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2717,21 +2717,24 @@ TaskManager::getContentExchangedEventListeners( const OUString& aOldPrefix,
 
                 m_aContent.erase( itold );
 
-                if( itnew != m_aContent.end() && !itnew->second.notifier.empty() )
+                if (itnew != m_aContent.end())
                 {
-                    std::vector<Notifier*>& listOfNotifiers = itnew->second.notifier;
-                    for (auto const& pointer : listOfNotifiers)
+                    if (!itnew->second.notifier.empty())
                     {
-                        std::unique_ptr<ContentEventNotifier> notifier = pointer->cEXC( aNewName );
-                        if( notifier )
-                            aVector.push_back( std::move(notifier) );
+                        std::vector<Notifier*>& listOfNotifiers = itnew->second.notifier;
+                        for (auto const& pointer : listOfNotifiers)
+                        {
+                            std::unique_ptr<ContentEventNotifier> notifier = pointer->cEXC( aNewName );
+                            if( notifier )
+                                aVector.push_back( std::move(notifier) );
+                        }
                     }
-                }
 
-                // Merge with preexisting notifiers
-                // However, these may be in status BaseContent::Deleted
-                for( const auto& rCopyPtr : copyList )
-                    itnew->second.notifier.push_back( rCopyPtr );
+                    // Merge with preexisting notifiers
+                    // However, these may be in status BaseContent::Deleted
+                    for( const auto& rCopyPtr : copyList )
+                        itnew->second.notifier.push_back( rCopyPtr );
+                }
             }
         }
     }


More information about the Libreoffice-commits mailing list