mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
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.
This commit is contained in:
@@ -124,7 +124,7 @@ bool HardwareCANPacket::EncodeFromMessage(const CANMessage& message, std::vector
|
||||
|
||||
const optional<uint8_t> 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user