From 704fabd1a4f086f32e730edb6dec34050844de54 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 5 Aug 2022 15:15:42 +0200 Subject: [PATCH] check M command against max DCC packet size --- DCCEXParser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index d1630c2..e9047a6 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -354,7 +354,8 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream) case 'P': // WRITE TRANSPARENT DCC PACKET PROG

// NOTE: this command was parsed in HEX instead of decimal params--; // drop REG - if (params<1) break; + if (params<1) break; + if (params > MAX_PACKET_SIZE) break; { byte packet[params]; for (int i=0;i