Fixed GetEvent initialization of linked list (#1026)

* Fixed GetEvent usage of linked list by initializing next in all the examples and unit test.

* Secured GetEventInformation encoders by accepting NULL for APDU for determining the size, and exploit the NULL APDU for size checking during encoding. Secured the GetEventInformation decoders and removed the use of deprecated decoder API.
This commit is contained in:
Steve Karg
2025-06-20 13:34:39 -05:00
committed by GitHub
parent b0a97c6f75
commit 14f033ceda
7 changed files with 498 additions and 300 deletions
+2 -6
View File
@@ -111,14 +111,10 @@ static void My_Get_Event_Ack_Handler(
BACNET_CONFIRMED_SERVICE_ACK_DATA *service_data)
{
int len = 0;
int i;
BACNET_GET_EVENT_INFORMATION_DATA data[MAX_OBJ_IDS_IN_GE_ACK];
BACNET_GET_EVENT_INFORMATION_DATA data[MAX_OBJ_IDS_IN_GE_ACK] = { 0 };
(void)src;
for (i = 0; i < MAX_OBJ_IDS_IN_GE_ACK - 1; i++) {
data[i].next = &data[i + 1];
}
getevent_information_link_array(&data[0], ARRAY_SIZE(data));
printf(
"Recieved Ack. Saved invoke ID was %i, service returned %i\n",
Request_Invoke_ID, service_data->invoke_id);