Skip to content

Commit 1daacdf

Browse files
nkljajicrzr
authored andcommitted
GH-26: Fix infinite loop on invalid next configuration parameter.
When 'Parameter Number' and 'Next Parameter Number' are equal, configuration parameter discovery can not complete. For example, this Z-Wave frame will set Node Interview into an infinite loop: 70 : COMMAND_CLASS_CONFIGURATION 0F : CONFIGURATION_PROPERTIES_REPORT_V4 00 : Parameter Number 1 (MSB) 71 : Parameter Number 2 (LSB) 09 : Format 0x01 Unsigned Integer, size 0x1 01 : Min Value 64 : Max Value 0A : Default Value 00 : Next Parameter Number (MSB) 71 : Next Parameter Number (LSB) 02 : No Bulk support 0x1, Not Advanced Parameter 0x0 Signed-off-by: Nenad Kljajic <[email protected]>
1 parent ec2815a commit 1daacdf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

applications/zpc/components/zwave_command_classes/src/zwave_command_class_configuration_control.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,16 @@ static sl_status_t
723723
if (frame_length >= (current_index + 2)) {
724724
next_id = (configuration_parameter_id_t)((frame[current_index] << 8)
725725
| frame[current_index + 1]);
726+
if (next_id == parameter_id) {
727+
sl_log_debug(LOG_TAG,
728+
"NodeID %d:%d reports that next parameter number %d"
729+
"equals the current one %d, ignoring.",
730+
info->remote.node_id,
731+
info->remote.endpoint_id,
732+
next_id,
733+
parameter_id);
734+
next_id = 0;
735+
}
726736
// Indicate the next parameter to search for:
727737
attribute_store_set_desired(next_id_node, &next_id, sizeof(next_id));
728738
// Set the reported, then undefine it so the resolver tries a new get immediately.
@@ -1616,4 +1626,4 @@ sl_status_t zwave_command_class_configuration_init()
16161626
zwave_command_handler_register_handler(handler);
16171627

16181628
return SL_STATUS_OK;
1619-
}
1629+
}

0 commit comments

Comments
 (0)