From 59339158074cae029f797cb23c1220ff7df20ceb Mon Sep 17 00:00:00 2001 From: cfif Date: Thu, 29 Jan 2026 14:01:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CanUds.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CanUds.c b/CanUds.c index e51f9ab..848aa8d 100644 --- a/CanUds.c +++ b/CanUds.c @@ -285,6 +285,11 @@ static uint16_t WriteDataByIdentifier_2E(tCanUds *env) { if (uds_WriteDataByIdentifier_2E_com_F1[dataIdentifier_lo].data != NULL) { uint16_t size = uds_WriteDataByIdentifier_2E_com_F1[dataIdentifier_lo].size; + if (env->data.len != size + 3) { + return setResponseError(env, UDS_WriteDataByIdentifier, + UDS_error_incorrectMessageLengthOrInvalidFormat); + } + env->dataResponse[0] = UDS_WriteDataByIdentifier | 0b1000000; env->dataResponse[1] = dataIdentifier_hi; env->dataResponse[2] = dataIdentifier_lo; @@ -350,6 +355,11 @@ static uint16_t InputOutputControlByIdentifier_2F(tCanUds *env) { if (uds_IoDataByIdentifier_2F_com_F1[dataIdentifier_lo].data != NULL) { uint16_t size = uds_IoDataByIdentifier_2F_com_F1[dataIdentifier_lo].size; + if (env->data.len != size + 4) { + return setResponseError(env, UDS_InputOutputControlByIdentifier, + UDS_error_incorrectMessageLengthOrInvalidFormat); + } + env->dataResponse[0] = UDS_WriteDataByIdentifier | 0b1000000; env->dataResponse[1] = dataIdentifier_hi; env->dataResponse[2] = dataIdentifier_lo;