Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r595ed1fbe8066960afd4c8fea168208e81b173d9 -r057d3ef4e29c63235040c5cfe8c6421ef7787d6a --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 595ed1fbe8066960afd4c8fea168208e81b173d9) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 057d3ef4e29c63235040c5cfe8c6421ef7787d6a) @@ -86,6 +86,7 @@ LOG_ERROR(tr("Unknown Message ID (UI) '%1'").arg(mActionIdHexString)); ok = false; break; + } return ok; } @@ -112,13 +113,16 @@ case eChlid_HD_Sync: ok = interpretMessage_HD(vMessage, vData); break; + case eChlid_DG_UI: //case eChlid_DG_Alarm: //case eChlid_DG_Sync: ok = interpretMessage_DG(vMessage, vData); break; + default: break; + } return ok; } @@ -211,6 +215,7 @@ default: printUnhandled (vMessage); break; + } return ok; } @@ -250,6 +255,7 @@ if ( vMessage.actionId != Gui::GuiActionType::PowerOff) { return false; } + if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::PowerOff] ) { QString mActionIdHexString = Format::toHexString(vMessage.actionId); LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString)); @@ -296,6 +302,7 @@ if ( vMessage.actionId != Gui::GuiActionType::BloodFlow ) { return false; } + if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::BloodFlow] ) { QString mActionIdHexString = Format::toHexString(vMessage.actionId); LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString)); @@ -342,6 +349,7 @@ if ( vMessage.actionId != Gui::GuiActionType::DialysateInletFlow ) { return false; } + if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::DialysateInletFlow] ) { QString mActionIdHexString = Format::toHexString(vMessage.actionId); LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString)); @@ -389,6 +397,7 @@ if ( vMessage.actionId != Gui::GuiActionType::DialysateOutletFlow ) { return false; } + if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::DialysateOutletFlow] ) { QString mActionIdHexString = Format::toHexString(vMessage.actionId); LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString)); @@ -433,6 +442,7 @@ if ( vMessage.actionId != Gui::GuiActionType::TreatmentTime ) { return false; } + if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::TreatmentTime] ) { QString mActionIdHexString = Format::toHexString(vMessage.actionId); LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString)); @@ -480,6 +490,7 @@ if ( vMessage.actionId != Gui::GuiActionType::AlarmStatus ) { return false; } + if ( vMessage.data.length() < payloadLen[Gui::GuiActionType::AlarmStatus] ) { QString mActionIdHexString = Format::toHexString(vMessage.actionId); LOG_ERROR(tr("Incorrect data for Message ID (HD) '%1'").arg(mActionIdHexString));