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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user