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

QUuid::Id128Bytes UB when accessing members

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.6, 6.7.0 FF, dev
    • Core: Plugins
    • None

    Description

      The nested Id128Bytes type is a union. In every union, there is at most one active member. Accessing another than the active member is UB. Yet the Qt code using Id128Bytes accesses members by convenience for the task at hand, not by which one is active.

      In particular, qbswap(Id128Bytes), which cannot possibly know which field is active, is using the data64 members while most of the other functions use data (ie. data8).

      Acceptance criteria:

      • Fix all Qt code to not assume a field it didn't access is active.
      • Make sure all inline code only accesses data (e.g. operator QByteArrayView already does this)
      • Make sure all Id128Bytes returned from Qt code have the data member active.

      Attachments

        For Gerrit Dashboard: QTBUG-120637
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change