Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.7.0
-
None
-
f4d3c87f0caab71f15e12f0f376f94a3e90a8adf
Description
Possible signed integer overflow in QProgressBar::reset is undefined behaviour as per C++11:
d->value = d->minimum - 1;
if (d->minimum == INT_MIN)
d->value = INT_MIN;
If d->minimum is INT_MIN already, subtracting one from it results in UB. A minor transformation helps already:
if (d->minimum == INT_MIN) d->value = INT_MIN; else d->value = d->minimum - 1;