Hello community,

here is the log from the commit of package kadu for openSUSE:12.1:Update:Test 
checked in at 2011-12-19 18:17:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1:Update:Test/kadu (Old)
 and      /work/SRC/openSUSE:12.1:Update:Test/.kadu.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kadu", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:12.1:Update:Test/kadu/kadu.changes       2011-12-19 
18:17:31.000000000 +0100
+++ /work/SRC/openSUSE:12.1:Update:Test/.kadu.new/kadu.changes  2011-12-19 
18:17:31.000000000 +0100
@@ -1,0 +2,8 @@
+Thu Dec 15 18:24:05 UTC 2011 - [email protected]
+
+- kadu-0.10.1-fix-enchant.patch: fix crash without enchant
+  dictionary (bnc#735465)
+- kadu-0.10.1-sensible-error-messages.patch: provide more sensible
+  error messages
+
+-------------------------------------------------------------------

New:
----
  kadu-0.10.1-fix-enchant.patch
  kadu-0.10.1-sensible-error-messages.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kadu.spec ++++++
--- /var/tmp/diff_new_pack.8PZCnG/_old  2011-12-19 18:17:32.000000000 +0100
+++ /var/tmp/diff_new_pack.8PZCnG/_new  2011-12-19 18:17:32.000000000 +0100
@@ -30,6 +30,10 @@
 Source0:        http://download.kadu.im/stable/%{name}-%{version}.tar.bz2
 # PATCH-FEATURE-OPENSUSE enable_external_plugins.patch [email protected]
 Patch0:         enable_external_plugins.patch
+# PATCH-FIX-UPSTREAM kadu-0.10.1-fix-enchant.patch bnc#735465 
[email protected] -- fix crash without enchant dictionary
+Patch1:         kadu-0.10.1-fix-enchant.patch
+# PATCH-FEATURE-UPSTREAM kadu-0.10.1-sensible-error-messages.patch 
[email protected] -- provide more sensible error messages
+Patch2:         kadu-0.10.1-sensible-error-messages.patch
 ### 1x - External Plugins ###
 Source10:       http://kadu.net/~weagle/anonymous_check-0.10.1.tar.bz2
 Source11:       http://ultr.pl/kadu/globalhotkeys-0.10-26.tar.gz
@@ -305,6 +309,9 @@
 # networkping, nextinfo, panelkadu, senthistory
 #
 %patch0
+#
+%patch1 -p1
+%patch2 -p1
 # don't enable mpd since it's not in oss repository
 sed -e 's:\t\tmpd_mediaplayer:\t\t# mpd_mediaplayer:' -i Plugins.cmake
 

++++++ kadu-0.10.1-fix-enchant.patch ++++++
>From 260df8e8d27e0550f0b548f5f925d67a0a3ea826 Mon Sep 17 00:00:00 2001
From: Bartosz Brachaczek <[email protected]>
Date: Wed, 7 Dec 2011 19:46:43 +0100
Subject: [PATCH] spellchecker: Fix possible crash in enchant code

If enchant exception was thrown here, QMap::operator[] would create
entry with null pointer which would be dereferenced later.
QMap::insert() avoids that.

Change also other backends' code for consistency.

Reported by wojtek on IRC. Thanks to whe for spotting the actual issue
in the code.

Signed-off-by: Bartosz Brachaczek <[email protected]>
---
 plugins/spellchecker/spellchecker.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/spellchecker/spellchecker.cpp 
b/plugins/spellchecker/spellchecker.cpp
index 250ed7d..495f483 100644
--- a/plugins/spellchecker/spellchecker.cpp
+++ b/plugins/spellchecker/spellchecker.cpp
@@ -163,11 +163,11 @@ bool SpellChecker::addCheckedLang(const QString &name)
                return false;
        }
        else
-               MyCheckers[name] = to_aspell_speller(possibleErr);
+               MyCheckers.insert(name, to_aspell_speller(possibleErr));
 #elif defined(HAVE_ENCHANT)
        try
        {
-               MyCheckers[name] = 
enchant::Broker::instance()->request_dict(name.toStdString());
+               MyCheckers.insert(name, 
enchant::Broker::instance()->request_dict(name.toStdString()));
        }
        catch (enchant::Exception &e)
        {
@@ -175,7 +175,7 @@ bool SpellChecker::addCheckedLang(const QString &name)
                return false;
        }
 #elif defined(Q_WS_MAC)
-       MyCheckers[name] = new MacSpellChecker();
+       MyCheckers.insert(name, new MacSpellChecker());
 #endif
 
        if (MyCheckers.size() == 1)
-- 
1.7.6

++++++ kadu-0.10.1-sensible-error-messages.patch ++++++
>From b409a7784364c3b9df4f1886c67a1075ffa078d4 Mon Sep 17 00:00:00 2001
From: Bartosz Brachaczek <[email protected]>
Date: Wed, 7 Dec 2011 21:10:30 +0100
Subject: [PATCH] spellchecker: Provide more sensible error messages

Signed-off-by: Bartosz Brachaczek <[email protected]>
---
 plugins/spellchecker/spellchecker.cpp              |   24 ++++++++++++++-----
 .../spellchecker/translations/spellchecker_en.ts   |    8 ++++++
 .../spellchecker/translations/spellchecker_pl.ts   |    8 ++++++
 3 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/plugins/spellchecker/spellchecker.cpp 
b/plugins/spellchecker/spellchecker.cpp
index 495f483..1b25e56 100644
--- a/plugins/spellchecker/spellchecker.cpp
+++ b/plugins/spellchecker/spellchecker.cpp
@@ -152,18 +152,21 @@ bool SpellChecker::addCheckedLang(const QString &name)
        if (MyCheckers.contains(name))
                return true;
 
+       bool ok = true;
+       const char *errorMsg = 0;
+
 #if defined(HAVE_ASPELL)
        aspell_config_replace(SpellConfig, "lang", name.toAscii().constData());
 
        // create spell checker using prepared configuration
        AspellCanHaveError *possibleErr = new_aspell_speller(SpellConfig);
-       if (aspell_error_number(possibleErr) != 0)
+       if (aspell_error_number(possibleErr) == 0)
+               MyCheckers.insert(name, to_aspell_speller(possibleErr));
+       else
        {
-               MessageDialog::show(KaduIcon("dialog-error"), tr("Kadu"), 
aspell_error_message(possibleErr));
-               return false;
+               errorMsg = aspell_error_message(possibleErr);
+               ok = false;
        }
-       else
-               MyCheckers.insert(name, to_aspell_speller(possibleErr));
 #elif defined(HAVE_ENCHANT)
        try
        {
@@ -171,13 +174,20 @@ bool SpellChecker::addCheckedLang(const QString &name)
        }
        catch (enchant::Exception &e)
        {
-               MessageDialog::show(KaduIcon("dialog-error"), tr("Kadu"), 
e.what());
-               return false;
+               errorMsg = e.what();
+               ok = false;
        }
 #elif defined(Q_WS_MAC)
        MyCheckers.insert(name, new MacSpellChecker());
 #endif
 
+       if (!ok)
+       {
+               MessageDialog::show(KaduIcon("dialog-error"), tr("Kadu"), 
tr("Could not find dictionary for %1 language.").arg(name)
+                               + (qstrlen(errorMsg) > 0 ? tr("Details: 
%1.").arg(errorMsg) : QString()));
+               return false;
+       }
+
        if (MyCheckers.size() == 1)
                foreach (ChatWidget *chat, 
ChatWidgetManager::instance()->chats())
                        chatCreated(chat);
diff --git a/plugins/spellchecker/translations/spellchecker_en.ts 
b/plugins/spellchecker/translations/spellchecker_en.ts
index 36f3582..4693cb5 100644
--- a/plugins/spellchecker/translations/spellchecker_en.ts
+++ b/plugins/spellchecker/translations/spellchecker_en.ts
@@ -59,6 +59,14 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
+        <source>Could not find dictionary for %1 language.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Details: %1.</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
         <source>Move to &apos;Checked&apos;</source>
         <translation type="unfinished"></translation>
     </message>
diff --git a/plugins/spellchecker/translations/spellchecker_pl.ts 
b/plugins/spellchecker/translations/spellchecker_pl.ts
index b252517..94bdf18 100644
--- a/plugins/spellchecker/translations/spellchecker_pl.ts
+++ b/plugins/spellchecker/translations/spellchecker_pl.ts
@@ -59,6 +59,14 @@
         <translation>Kadu</translation>
     </message>
     <message>
+        <source>Could not find dictionary for %1 language.</source>
+        <translation>Nie można znaleźć słownika dla języka %1.</translation>
+    </message>
+    <message>
+        <source>Details: %1.</source>
+        <translation>Szczegóły: %1.</translation>
+    </message>
+    <message>
         <source>Move to &apos;Checked&apos;</source>
         <translation>Przenieś do &apos;Sprawdzane&apos;</translation>
     </message>
-- 
1.7.6

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to