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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/powerdevil/commit/2ebe65
                   |                            |5d220c9167b66893a823b2fff2e
                   |                            |2b8a531
             Status|CONFIRMED                   |RESOLVED

--- Comment #29 from ratijas <m...@ratijas.tk> ---
Git commit 2ebe655d220c9167b66893a823b2fff2e2b8a531 by ivan tkachenko.
Committed on 15/06/2022 at 22:24.
Pushed by ratijas into branch 'master'.

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.

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

https://invent.kde.org/plasma/powerdevil/commit/2ebe655d220c9167b66893a823b2fff2e2b8a531

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

Reply via email to