Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.10
-
None
-
1145e1709 (dev)
Description
Integer-based geometry classes (QPoint, QRect, QSize, ...) are susceptible of signed overflow and underflow, which is UB.
For instance QRect::width() returns right-left+1, and with right and left spaced enough, the subtraction will overflow.
Unfortunately a lot of these methods are marked noexcept, so I'm not supposed to put a Q_ASSERT (soon: Q_PRE, because this is 100% testable by the user before attempting the operation; these are glorified int holders) in them to warn the user that there's something wrong.
Should we get rid of these noexcept? If so, what's the API/ABI impact?
(The alternative would be to redesign these classes to properly handle these boundary conditions, but that's an even worse API break.)
Attachments
Issue Links
- relates to
-
QTBUG-98965 As a Qt developer, I would like to test Q_ASSERTions without having to spin a separate process
-
- In Progress
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-132947 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
620580,9 | Geometry classes: introduce check for overflows | dev | qt/qtbase | Status: ABANDONED | 0 | -1 |
621931,11 | Geometry classes: introduce check for overflows | dev | qt/qtbase | Status: MERGED | +2 | 0 |