[Digikam-devel] [digikam] [Bug 355831] MySQL Schema Improvements

via KDE Bugzilla bugzilla_noreply at kde.org
Thu Nov 26 21:52:26 GMT 2015


https://bugs.kde.org/show_bug.cgi?id=355831

caulier.gilles at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #95747|0                           |1
        is obsolete|                            |

--- Comment #25 from caulier.gilles at gmail.com ---
Comment on attachment 95747
  --> https://bugs.kde.org/attachment.cgi?id=95747
Fix array under/overflow when m_isStopProcessing is set to true

>From 61762e8ed5083c791d553ddc43f278c7e08b54eb Mon Sep 17 00:00:00 2001
>From: Richard Mortimer <richm at oldelvet.org.uk>
>Date: Wed, 25 Nov 2015 21:10:23 +0000
>Subject: [PATCH 3/3] Ensure that m_isStopProcessing does not cause array
> overshoots
>
>---
> libs/database/coredb/coredbcopymanager.cpp | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
>diff --git a/libs/database/coredb/coredbcopymanager.cpp b/libs/database/coredb/coredbcopymanager.cpp
>index e2f3115..e3cbf09 100644
>--- a/libs/database/coredb/coredbcopymanager.cpp
>+++ b/libs/database/coredb/coredbcopymanager.cpp
>@@ -126,7 +126,8 @@ void CoreDbCopyManager::copyDatabases(const DbEngineParameters& fromDBParameters
> 
>     for (int i=(tablesSize - 1); m_isStopProcessing || i >= 0; --i)
>     {
>-        if (toDBbackend.execDirectSql(QString::fromUtf8("DROP TABLE IF EXISTS %1;").arg(tables[i])) != BdEngineBackend::NoErrors)
>+        if ( m_isStopProcessing ||
>+             toDBbackend.execDirectSql(QString::fromUtf8("DROP TABLE IF EXISTS %1;").arg(tables[i])) != BdEngineBackend::NoErrors)
>         {
>             emit finished(CoreDbCopyManager::failed, i18n("Error while scrubbing the target database."));
>             fromDBbackend.close();
>@@ -135,7 +136,8 @@ void CoreDbCopyManager::copyDatabases(const DbEngineParameters& fromDBParameters
>         }
>     }
> 
>-    if (toDBbackend.execDirectSql(QString::fromUtf8("DROP TABLE IF EXISTS Settings;")) != BdEngineBackend::NoErrors)
>+    if ( m_isStopProcessing ||
>+         toDBbackend.execDirectSql(QString::fromUtf8("DROP TABLE IF EXISTS Settings;")) != BdEngineBackend::NoErrors)
>     {
>         emit finished(CoreDbCopyManager::failed, i18n("Error while scrubbing the target database."));
>         fromDBbackend.close();
>@@ -162,7 +164,9 @@ void CoreDbCopyManager::copyDatabases(const DbEngineParameters& fromDBParameters
> 
>     for (int i=0; m_isStopProcessing || i < tablesSize; ++i)
>     {
>-        emit stepStarted(i18n(QString::fromUtf8("Copy %1...").arg(tables[i]).toLatin1().constData()));
>+        if (i < tablesSize) {
>+            emit stepStarted(i18n(QString::fromUtf8("Copy %1...").arg(tables[i]).toLatin1().constData()));
>+        }
> 
>         // Now perform the copy action
> 
>-- 
>2.5.0
>

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list