Skip to content

Commit

Permalink
Fixing a potential array bounds violation in ESPDMX
Browse files Browse the repository at this point in the history
DMXESPSerial::write and DMXESPSerial::read could access DMXDataStore[512] -   one more than the allocated number of elements (i.e. 0...511].
  • Loading branch information
softhack007 authored and blazoncek committed Feb 17, 2024
1 parent 989bdfb commit 21173dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wled00/src/dependencies/dmx/ESPDMX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
bool dmxStarted = false;
int sendPin = 2; //default on ESP8266

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


Expand Down Expand Up @@ -106,4 +106,4 @@ void DMXESPSerial::update() {

// Function to update the DMX bus

#endif
#endif

0 comments on commit 21173dc

Please sign in to comment.