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

UB when passing null string to QString::arg()

    XMLWordPrintable

Details

    • d351a97e8 (dev), 923918c66 (6.7), 59a273d15 (6.6), a175c5266 (tqtc/lts-6.5)

    Description

      UBsan complains when building qtdeclarative because a null pointer is passed as an argument to memcpy when that argument is declared non-null.

      This happens because a null string is passed to QString::arg().

      Passing a null string to QString::arg() may seem silly but it can occur in code where it would make sense to expect it to work.
      https://codereview.qt-project.org/c/qt/qtdeclarative/+/528756?tab=comments

      The documentation for QString::arg() doesn't say anything about not expecting a null string.

       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change