https://bugs.kde.org/show_bug.cgi?id=454161

ratijas <m...@ratijas.tk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
                   |ma/powerdevil/commit/2ebe65 |ma/powerdevil/commit/dd74cd
                   |5d220c9167b66893a823b2fff2e |bdd3849fbd86e6613ef7ecab6c7
                   |2b8a531                     |857cb89

--- Comment #30 from ratijas <m...@ratijas.tk> ---
Git commit dd74cdbdd3849fbd86e6613ef7ecab6c7857cb89 by ivan tkachenko.
Committed on 16/06/2022 at 18:17.
Pushed by ratijas into branch 'Plasma/5.25'.

upower: Prevent integer overflow during new brightness computation

Provably, if two integers can fit in 31 bits each, the result of their
multiplication is expressible in 62 bits (let alone 63 available). So,
this should be safe. And the division can't do much harm: the divisor
is always at least 1, and worst case scenario — it would be so big that
the overall results becomes zero.

This code still assumes that the allowed brightness values can fit in 32
bits int, which is not totally unreasonable so far.


(cherry picked from commit 2ebe655d220c9167b66893a823b2fff2e2b8a531)

M  +7    -4    daemon/backends/upower/backlighthelper.cpp

https://invent.kde.org/plasma/powerdevil/commit/dd74cdbdd3849fbd86e6613ef7ecab6c7857cb89

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to