[SCM] Qt 4 Debian packaging branch, experimental-snapshots, updated. debian/4.6.0-1-6-g76a2b12

Fathi Boudra fabo at alioth.debian.org
Mon Dec 21 15:01:53 UTC 2009


The following commit has been merged in the experimental-snapshots branch:
commit 76a2b124b625ea9faa09ed85e0873f0e5d17e995
Author: Fathi Boudra <fabo at kde.org>
Date:   Mon Dec 21 16:01:34 2009 +0100

    Add 94_fix_crash_in_qdbuspendingreply_qdbusreply.diff patch to fix a crash
    in QDBusPendingReply/QDBusReply in case of unconnected calls.
    (Closes: #560838)
---
 debian/changelog                                   |    3 +
 ..._fix_crash_in_qdbuspendingreply_qdbusreply.diff |  122 ++++++++++++++++++++
 debian/patches/series                              |    2 +-
 3 files changed, 126 insertions(+), 1 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 84e6cba..384398b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,9 @@ qt4-x11 (4:4.6.0-2) UNRELEASED; urgency=low
   [ Fathi Boudra ]
   * Add 93_jsvalue64_on_ia64.diff patch to fix ftbfs on IA64 due to lack of
     WTF_USE_JSVALUE64. Thanks to Scott Kitterman.
+  * Add 94_fix_crash_in_qdbuspendingreply_qdbusreply.diff patch to fix a crash
+    in QDBusPendingReply/QDBusReply in case of unconnected calls.
+    (Closes: #560838)
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Sun, 13 Dec 2009 18:43:29 +0200
 
diff --git a/debian/patches/94_fix_crash_in_qdbuspendingreply_qdbusreply.diff b/debian/patches/94_fix_crash_in_qdbuspendingreply_qdbusreply.diff
new file mode 100644
index 0000000..f3490b9
--- /dev/null
+++ b/debian/patches/94_fix_crash_in_qdbuspendingreply_qdbusreply.diff
@@ -0,0 +1,122 @@
+From 970f19bdb55cd559e9ef97228d30fd52b20e39cb Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira at nokia.com>
+Date: Tue, 8 Dec 2009 20:28:45 +0100
+Subject: [PATCH] Fix crash in QDBusPendingReply/QDBusReply in case of unconnected calls.
+
+If we made calls on a QDBusConnection that isn't connected, the d
+pointer is 0. Ensure we don't crash.
+
+Task-number: QTBUG-6571
+Reviewed-by: Bradley T. Hughes
+---
+ src/dbus/qdbuspendingcall.cpp                      |    2 +-
+ src/dbus/qdbuspendingreply.h                       |    1 +
+ .../qdbuspendingreply/tst_qdbuspendingreply.cpp    |   25 ++++++++++++++++++++
+ tests/auto/qdbusreply/tst_qdbusreply.cpp           |   16 ++++++++++++
+ 4 files changed, 43 insertions(+), 1 deletions(-)
+
+diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
+index d10179e..d8eb53e 100644
+--- a/src/dbus/qdbuspendingcall.cpp
++++ b/src/dbus/qdbuspendingcall.cpp
+@@ -310,7 +310,7 @@ QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other)
+ 
+ bool QDBusPendingCall::isFinished() const
+ {
+-    return d && (d->replyMessage.type() != QDBusMessage::InvalidMessage);
++    return !d || (d->replyMessage.type() != QDBusMessage::InvalidMessage);
+ }
+ 
+ void QDBusPendingCall::waitForFinished()
+diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h
+index b7f54e4..4f90c98 100644
+--- a/src/dbus/qdbuspendingreply.h
++++ b/src/dbus/qdbuspendingreply.h
+@@ -188,6 +188,7 @@ public:
+ private:
+     inline void calculateMetaTypes()
+     {
++        if (!d) return;
+         int typeIds[Count > 0 ? Count : 1]; // use at least one since zero-sized arrays aren't valid
+         ForEach::fillMetaTypes(typeIds);
+         setMetaTypes(Count, typeIds);
+diff --git a/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp b/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp
+index 6398d9c..82e6389 100644
+--- a/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp
++++ b/tests/auto/qdbuspendingreply/tst_qdbuspendingreply.cpp
+@@ -93,6 +93,7 @@ private slots:
+     }
+ 
+     void init();
++    void unconnected();
+     void simpleTypes();
+     void complexTypes();
+     void wrongTypes();
+@@ -252,6 +253,30 @@ void tst_QDBusPendingReply::init()
+     QVERIFY(iface->isValid());
+ }
+ 
++void tst_QDBusPendingReply::unconnected()
++{
++    QDBusConnection con("invalid stored connection");
++    QVERIFY(!con.isConnected());
++    QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con);
++    QVERIFY(!iface.isValid());
++
++    QDBusPendingReply<> rvoid = iface.asyncCall("ReloadConfig");
++    QVERIFY(rvoid.isFinished());
++    QVERIFY(!rvoid.isValid());
++    QVERIFY(rvoid.isError());
++    rvoid.waitForFinished();
++    QVERIFY(!rvoid.isValid());
++    QVERIFY(rvoid.isError());
++
++    QDBusPendingReply<QString> rstring = iface.asyncCall("GetId");
++    QVERIFY(rstring.isFinished());
++    QVERIFY(!rstring.isValid());
++    QVERIFY(rstring.isError());
++    rstring.waitForFinished();
++    QVERIFY(!rstring.isValid());
++    QVERIFY(rstring.isError());
++}
++
+ void tst_QDBusPendingReply::simpleTypes()
+ {
+     QDBusPendingReply<> rvoid = iface->asyncCall("retrieveVoid");
+diff --git a/tests/auto/qdbusreply/tst_qdbusreply.cpp b/tests/auto/qdbusreply/tst_qdbusreply.cpp
+index 9866302..e36d288 100644
+--- a/tests/auto/qdbusreply/tst_qdbusreply.cpp
++++ b/tests/auto/qdbusreply/tst_qdbusreply.cpp
+@@ -93,6 +93,7 @@ private slots:
+     }
+ 
+     void init();
++    void unconnected();
+     void simpleTypes();
+     void complexTypes();
+     void wrongTypes();
+@@ -236,6 +237,21 @@ void tst_QDBusReply::init()
+     QVERIFY(iface->isValid());
+ }
+ 
++void tst_QDBusReply::unconnected()
++{
++    QDBusConnection con("invalid stored connection");
++    QVERIFY(!con.isConnected());
++    QDBusInterface iface("doesnt.matter", "/", "doesnt.matter", con);
++    QVERIFY(!iface.isValid());
++
++    QDBusReply<void> rvoid = iface.asyncCall("ReloadConfig");
++    QVERIFY(!rvoid.isValid());
++
++    QDBusReply<QString> rstring = iface.asyncCall("GetId");
++    QVERIFY(!rstring.isValid());
++    QVERIFY(rstring.value().isEmpty());
++}
++
+ void tst_QDBusReply::simpleTypes()
+ {
+     QDBusReply<bool> rbool = iface->call(QDBus::BlockWithGui, "retrieveBool");
+-- 
+1.6.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 917a96f..d48feac 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -35,4 +35,4 @@
 91_s390_-gstabs.diff
 92_armel_gcc43_valist_compat.diff
 93_jsvalue64_on_ia64.diff
-
+94_fix_crash_in_qdbuspendingreply_qdbusreply.diff

-- 
Qt 4 Debian packaging



More information about the pkg-kde-commits mailing list