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].
This commit is contained in:
Frank 2024-02-15 00:53:00 +01:00 committed by GitHub
parent 0a815179a2
commit 8422ffcd19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
@ -106,4 +106,4 @@ void DMXESPSerial::update() {
// Function to update the DMX bus
#endif
#endif