mirror of
https://github.com/wled/WLED.git
synced 2025-04-24 14:57:18 +00:00
Update usermod_seven_segment_reloaded.h - prevent array bounds violation (solves #4121)
I'm not the maintainer of this usermod, but its obvious that the code might overrun array bounds, so fixing this.
This commit is contained in:
parent
0642b17ab0
commit
81cec6a25a
@ -236,6 +236,8 @@ private:
|
||||
}
|
||||
|
||||
void _setLeds(int lednr, int lastSeenLedNr, bool range, int countSegments, int number, bool colon) {
|
||||
if ((lednr < 0) || (lednr >= umSSDRLength)) return; // prevent array bounds violation
|
||||
if ((number < 0) || (countSegments < 0) || (lastSeenLedNr <0)) return; // prevent array out of range access
|
||||
|
||||
if ((colon && umSSDRColonblink) || umSSDRNumbers[number][countSegments]) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user