diff --git a/CHANGELOG.md b/CHANGELOG.md index dc17a26a..bee987d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The git repositories are hosted at the following sites: ### Fixed +* Fixed copy and compare API of BACnetObjectPropertyReference structure. (#1171) * Fixed array-bounds on BACnetObjectPropertyReference parsing. (#1167) * Fixed the missing BACnetObjectPropertyReference, BACnetSCFailedConnectionRequest, BACnetSCHubFunctionConnection, diff --git a/src/bacnet/bacdevobjpropref.c b/src/bacnet/bacdevobjpropref.c index 01fd4c57..d5386de8 100644 --- a/src/bacnet/bacdevobjpropref.c +++ b/src/bacnet/bacdevobjpropref.c @@ -862,7 +862,8 @@ bool bacnet_object_property_reference_same( (value1->object_identifier.instance == value2->object_identifier.instance) && (value1->object_identifier.type == - value2->object_identifier.type)) { + value2->object_identifier.type) && + (value1->property_array_index == value2->property_array_index)) { status = true; } } @@ -886,6 +887,7 @@ bool bacnet_object_property_reference_copy( dest->property_identifier = src->property_identifier; dest->object_identifier.instance = src->object_identifier.instance; dest->object_identifier.type = src->object_identifier.type; + dest->property_array_index = src->property_array_index; status = true; } diff --git a/src/bacnet/basic/object/loop.c b/src/bacnet/basic/object/loop.c index 6a7d202c..39222788 100644 --- a/src/bacnet/basic/object/loop.c +++ b/src/bacnet/basic/object/loop.c @@ -1432,13 +1432,12 @@ bool Loop_COV_Increment_Set(uint32_t object_instance, float value) int Loop_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata) { int apdu_len = 0; /* return value */ - BACNET_BIT_STRING bit_string; - BACNET_CHARACTER_STRING char_string; - BACNET_UNSIGNED_INTEGER unsigned_value; - BACNET_OBJECT_PROPERTY_REFERENCE reference_value; - float real_value; + BACNET_BIT_STRING bit_string = { 0 }; + BACNET_CHARACTER_STRING char_string = { 0 }; + BACNET_UNSIGNED_INTEGER unsigned_value = 0; + BACNET_OBJECT_PROPERTY_REFERENCE reference_value = { 0 }; + float real_value = 0.0f; uint8_t *apdu = NULL; - uint32_t enum_value = 0; bool state = false;