From 7afa40390b26ad1f4cf93deaa0052fe7e357ef33 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Wed, 27 Mar 2024 12:26:58 +0000 Subject: [PATCH] - ACSE: added check for minimum message size (LIB61850-438) --- src/mms/iso_acse/acse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mms/iso_acse/acse.c b/src/mms/iso_acse/acse.c index f46b024d6..40ecafe04 100644 --- a/src/mms/iso_acse/acse.c +++ b/src/mms/iso_acse/acse.c @@ -420,6 +420,14 @@ AcseConnection_parseMessage(AcseConnection* self, ByteBuffer* message) { AcseIndication indication = ACSE_ERROR; + if (message == NULL || message->size < 1) + { + if (DEBUG_ACSE) + printf("ACSE: invalid message - no payload\n"); + + return ACSE_ERROR; + } + uint8_t* buffer = message->buffer; int messageSize = message->size;