Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130038

DBus: Sending a QVariantMap with null QVariant can crash the application

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.7.3
    • D-Bus
    • None
    • libdbus 1.14.10
    • Linux/X11
    • e1259868d (dev)

    Description

      QDBusMarshaller: cannot add a null QDBusVariant
      dbus[330030]: Array or variant type requires that type variant be written, but end_dict_entry was written.
      The overall signature expected here was 'a{sv}' and we are on byte 3 of that signature.
        D-Bus not built with -rdynamic so unable to print a backtrace
      
      #include <QCoreApplication>
      #include <QDBusConnection>
      #include <QDBusMessage>
      
      using namespace Qt::StringLiterals;
      
      static const QString busName = u"org.example.MyInterface"_s;
      static const QString path = u"/org/example/MyInterface"_s;
      
      int main(int argc, char *argv[])
      {
          QCoreApplication app(argc, argv);
          QMetaObject::invokeMethod(&app, [&app]{
              QDBusMessage message = QDBusMessage::createMethodCall(busName, path, busName, u"SetParams"_s);
              message << QVariantMap{{u"a"_s, QVariant()}};
              QDBusConnection::sessionBus().call(message);
              app.quit();
          }, Qt::QueuedConnection);
          return app.exec();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            fusionfuture Yuanzheng Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes