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

QDBusSignature considers an empty string to be an invalid signature

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.5.7, 6.7.2, 6.8.0 FF
    • 5.15.8
    • D-Bus
    • None
    • ed6d1fa71 (dev), 12ae2e807 (6.7), 9b779e9a3 (tqtc/lts-6.5), 11dbf8219 (dev), 9cc1825c0 (6.8), 017fbf4f4 (6.7), 672f83c62 (tqtc/lts-6.5)

    Description

      QDBusSignature seems to consider an empty signature to be invalid, even though this is allowed by the DBus specification (a signature is defined as "Zero or more single complete types", with zero types yielding an empty signature).

      This code will print a warning (QDBusSignature: invalid signature "") and then crash with a segmentation fault:

      #include <QtDBus/QDBusArgument>
      #include <QtDBus/QDBusSignature>
      
      int main() {
        QDBusSignature value("");
      
        QDBusArgument arg;
        arg << value;
        auto variant = QDBusVariant(QVariant::fromValue(arg));
      
        QDBusArgument arg2;
        arg2 << variant;
      }
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            steffen-kiess Steffen Kieß
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: