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

Regression: QQmlScriptString::operator==() crashes

    XMLWordPrintable

Details

    • ba6ddfab5 (dev), b76cb7cb6 (6.6)

    Description

      QQmlScriptString::operator==(const QQmlScriptString &) crashes if other is invalid, i.e. has a null d-pointer. It has a guard against its own d being null, but not against the other.d being null:

      bool QQmlScriptString::operator==(const QQmlScriptString &other) const
      {
          if (d == other.d)
              return true;
          if (!d)
              return false;
      
          // boom if other.d == nullptr
          if (d->isNumberLiteral || other.d->isNumberLiteral)
              return d->isNumberLiteral && other.d->isNumberLiteral && d->numberValue == other.d->numberValue;
      
          ...
      

      This effectively breaks all QQmlScriptString comparisons.

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            msarehn Arno Rehn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes