]> Skullheadx's Git Forge - slstatus.git/commit
fix buffer overflow in battery state parsing
authordrkhsh <me@drkhsh.at>
Thu, 12 Feb 2026 21:52:21 +0000 (22:52 +0100)
committerdrkhsh <me@drkhsh.at>
Thu, 12 Feb 2026 21:52:21 +0000 (22:52 +0100)
commit98769dfed7266b5a9959162e03bee1ddfaf5ecb4
tree5ef79b4995a89cff511eec651842639a653df9d7
parent4f61bbbd8e9278c75f29e7853ae8922717261d2d
fix buffer overflow in battery state parsing

"Not charging" is 12 characters; %12[a-zA-Z ] reads up to 12 chars
plus a NUL terminator (13 bytes) into a 12-byte buffer. Increase
state buffer to 13 in both battery_state and battery_remaining.
components/battery.c