Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.6, 6.7.0 FF, dev
-
None
-
f5b7e8a3f (dev), 2f8d5ea48 (6.8), 284ea3936 (6.7)
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
Gerrit Reviews
For Gerrit Dashboard: QTBUG-120637 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
528818,5 | QUuid:: fix UB in (Id128Bytes) ctor | dev | qt/qtbase | Status: MERGED | +2 | 0 |
583616,2 | QUuid:: fix UB in (Id128Bytes) ctor | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |
583661,2 | QUuid:: fix UB in (Id128Bytes) ctor | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
583749,1 | QUuid:: fix UB in (Id128Bytes) ctor | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: ABANDONED | 0 | 0 |