1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-19 23:46:02 +01:00

check M command against max DCC packet size

This commit is contained in:
Harald Barth 2022-08-05 15:15:42 +02:00
parent 6286f5fedf
commit 704fabd1a4

View File

@ -355,6 +355,7 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
// NOTE: this command was parsed in HEX instead of decimal // NOTE: this command was parsed in HEX instead of decimal
params--; // drop REG params--; // drop REG
if (params<1) break; if (params<1) break;
if (params > MAX_PACKET_SIZE) break;
{ {
byte packet[params]; byte packet[params];
for (int i=0;i<params;i++) { for (int i=0;i<params;i++) {