Enabled BACnetARRAY checking when using proplist.c and added to apps/epics (#823)

This commit is contained in:
Steve Karg
2024-10-23 13:54:48 -05:00
committed by GitHub
parent d3de5c9491
commit dcf79b038f
15 changed files with 421 additions and 297 deletions
+8 -8
View File
@@ -300,6 +300,14 @@ bool Access_Rights_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
BACNET_APPLICATION_DATA_VALUE value = { 0 };
unsigned object_index = 0;
/* only array properties can have array options */
is_array = property_list_bacnet_array_member(
wp_data->object_type, wp_data->object_property);
if (!is_array && (wp_data->array_index != BACNET_ARRAY_ALL)) {
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
return false;
}
/* decode the some of the request */
len = bacapp_decode_application_data(
wp_data->application_data, wp_data->application_data_len, &value);
@@ -310,14 +318,6 @@ bool Access_Rights_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data)
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
return false;
}
/* only array properties can have array options */
is_array = property_list_bacnet_array_member(
wp_data->object_type, wp_data->object_property);
if (is_array && (wp_data->array_index != BACNET_ARRAY_ALL)) {
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
return false;
}
object_index = Access_Rights_Instance_To_Index(wp_data->object_instance);
switch (wp_data->object_property) {
case PROP_GLOBAL_IDENTIFIER: