From 8422ffcd19c767a58e82bacbcf011fc5b4774c36 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 15 Feb 2024 00:53:00 +0100 Subject: [PATCH] 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]. --- wled00/src/dependencies/dmx/ESPDMX.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/src/dependencies/dmx/ESPDMX.cpp b/wled00/src/dependencies/dmx/ESPDMX.cpp index d0d652c82..c9d1a894a 100644 --- a/wled00/src/dependencies/dmx/ESPDMX.cpp +++ b/wled00/src/dependencies/dmx/ESPDMX.cpp @@ -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 \ No newline at end of file +#endif