Opened 11 years ago

Closed 11 years ago

#4305 closed bug (fixed)

PowerStatus may divide with 0 and crash Deskbar

Reported by: tqh Owned by: axeld
Priority: normal Milestone: R1
Component: Applications/PowerStatus Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


PowerStatus reads a value without checking if it zero before doing a divide, which can crash Deskbar (and did so with the default ACPI code here).

Patch included.

Attachments (1)

PowerStatus.patch (818 bytes ) - added by tqh 11 years ago.
Fixed style on if(

Download all attachments as: .zip

Change History (6)

by tqh, 11 years ago

Attachment: PowerStatus.patch added

Fixed style on if(

comment:1 by tqh, 11 years ago

The idea is that we only update fPercent if we have full_capacity value other than 0. Otherwise we keep the old value, which may be -1 (never set) or the last known value.

comment:2 by axeld, 11 years ago

So far so good, but why setting the color to white? If there is no value, the battery should look the same way as if it isn't there.

comment:3 by axeld, 11 years ago

Component: ApplicationsApplications/PowerStatus

comment:4 by tqh, 11 years ago

I wanted to see when it hadn't gotten valid data, that it was in 'state unknown'. The color or if it should be there I leave to you, but it is at least useful for me atm.

comment:5 by axeld, 11 years ago

Resolution: fixed
Status: newclosed

Applied in hrev32888.

Note: See TracTickets for help on using tickets.