File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
applications/zpc/components/zwave_command_classes Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -554,7 +554,7 @@ static sl_status_t zwave_command_class_central_scene_control_handler(
554
554
const uint8_t * frame ,
555
555
uint16_t frame_length )
556
556
{
557
- if (frame_length < COMMAND_INDEX ) {
557
+ if (frame_length <= COMMAND_INDEX ) { // Should contain at least class and cmd
558
558
return SL_STATUS_NOT_SUPPORTED ;
559
559
}
560
560
@@ -793,4 +793,4 @@ sl_status_t zwave_command_class_central_scene_init()
793
793
zwave_command_handler_register_handler (handler );
794
794
795
795
return SL_STATUS_OK ;
796
- }
796
+ }
Original file line number Diff line number Diff line change @@ -346,13 +346,17 @@ void test_zwave_command_class_central_scene_configuration_set_no_slow_refresh()
346
346
void test_zwave_command_class_central_scene_frame_too_short ()
347
347
{
348
348
TEST_ASSERT_NOT_NULL (central_scene_handler .control_handler );
349
- const uint8_t incoming_frame [] = {COMMAND_CLASS_CENTRAL_SCENE_V3 };
350
-
351
- TEST_ASSERT_EQUAL (
352
- SL_STATUS_NOT_SUPPORTED ,
353
- central_scene_handler .control_handler (& connection_info ,
349
+ const uint8_t incoming_frame [] = {
350
+ COMMAND_CLASS_CENTRAL_SCENE_V3 ,
351
+ CENTRAL_SCENE_NOTIFICATION_V3 // Padding with deterministic valid cmd if overflow
352
+ };
353
+
354
+ TEST_ASSERT_EQUAL (SL_STATUS_NOT_SUPPORTED ,
355
+ central_scene_handler .control_handler (
356
+ & connection_info ,
354
357
incoming_frame ,
355
- sizeof (incoming_frame )));
358
+ sizeof (incoming_frame ) - 1 // remove padding
359
+ ));
356
360
}
357
361
358
362
void test_zwave_command_class_central_scene_frame_wrong_command_class ()
@@ -963,4 +967,4 @@ void test_zwave_command_class_central_scene_notification_return_scene_to_idle()
963
967
TEST_ASSERT_NOT_NULL (return_scene_to_idle );
964
968
return_scene_to_idle (endpoint_id_node );
965
969
verify_attribute_store_data_notification (0 , 0 );
966
- }
970
+ }
You can’t perform that action at this time.
0 commit comments