fix: Add input validation to Schedule_Recalculate_PV and Schedule_Timer functions to prevent segmentation fault occurring in Schedule_Recalculate_PV() during application startup (#1259)
This commit is contained in:
@@ -122,6 +122,13 @@ static void testSchedule(void)
|
||||
skip_fail_property_list);
|
||||
Schedule_Recalculate_PV(
|
||||
Schedule_Object(object_instance), BACNET_WEEKDAY_SUNDAY, &time_of_day);
|
||||
/* targeted tests for NULL pointer and invalid day of week */
|
||||
Schedule_Recalculate_PV(NULL, BACNET_WEEKDAY_SUNDAY, &time_of_day);
|
||||
Schedule_Recalculate_PV(Schedule_Object(object_instance), 0, &time_of_day);
|
||||
Schedule_Recalculate_PV(Schedule_Object(object_instance), 8, &time_of_day);
|
||||
Schedule_Recalculate_PV(
|
||||
Schedule_Object(object_instance), BACNET_WEEKDAY_SUNDAY, NULL);
|
||||
Schedule_Timer(BACNET_MAX_INSTANCE, 0);
|
||||
}
|
||||
/**
|
||||
* @}
|
||||
|
||||
Reference in New Issue
Block a user