From 10828bc6b825f87cbfec2bcf40a122eccfda3612 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Fri, 17 Dec 2021 21:19:55 +0000 Subject: [PATCH] catch bad params in F --- DCCEXParser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 4ed07af..d35db0b 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -485,6 +485,7 @@ void DCCEXParser::parse(Print *stream, byte *com, RingStream * ringStream) return; case 'F': // New command to call the new Loco Function API + if(params!=3) break; if (Diag::CMD) DIAG(F("Setting loco %d F%d %S"), p[0], p[1], p[2] ? F("ON") : F("OFF")); DCC::setFn(p[0], p[1], p[2] == 1);