From d4f6c1239407731a5f6eef7eb7fc968f10c5d570 Mon Sep 17 00:00:00 2001 From: Paul Hollinsky Date: Tue, 25 May 2021 17:23:41 -0400 Subject: [PATCH] CANPacket: Fix invalid length check This case is already checked above, and further was invalid since the length had already been translated to the numeric (0-64) value. --- communication/packet/canpacket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/communication/packet/canpacket.cpp b/communication/packet/canpacket.cpp index 4268a69..c20a3d9 100644 --- a/communication/packet/canpacket.cpp +++ b/communication/packet/canpacket.cpp @@ -109,7 +109,7 @@ bool HardwareCANPacket::EncodeFromMessage(const CANMessage& message, std::vector const optional lenFromDLC = CANFD_DLCToLength(message.dlcOnWire); if (lenFromDLC.has_value() && *lenFromDLC != 0) { - if (*lenFromDLC < lengthNibble || *lenFromDLC > 0xF) { + if (*lenFromDLC < lengthNibble) { report(APIEvent::Type::MessageMaxLengthExceeded, APIEvent::Severity::Error); return false; }