Skip to content

Commit 21173dc

Browse files
softhack007blazoncek
authored andcommitted
Fixing a potential array bounds violation in ESPDMX
DMXESPSerial::write and DMXESPSerial::read could access DMXDataStore[512] - one more than the allocated number of elements (i.e. 0...511].
1 parent 989bdfb commit 21173dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wled00/src/dependencies/dmx/ESPDMX.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
bool dmxStarted = false;
3131
int sendPin = 2; //default on ESP8266
3232

33-
//DMX value array and size. Entry 0 will hold startbyte
34-
uint8_t dmxDataStore[dmxMaxChannel] = {};
33+
//DMX value array and size. Entry 0 will hold startbyte, so we need 512+1 elements
34+
uint8_t dmxDataStore[dmxMaxChannel+1] = {};
3535
int channelSize;
3636

3737

@@ -106,4 +106,4 @@ void DMXESPSerial::update() {
106106

107107
// Function to update the DMX bus
108108

109-
#endif
109+
#endif

0 commit comments

Comments
 (0)