Fixed the use of uninitialized values in COV handlers. (#1049)

This commit is contained in:
Steve Karg
2025-07-16 16:30:39 -05:00
committed by GitHub
parent 4f11defc4e
commit b819dc329f
2 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -127,13 +127,13 @@ void handler_ccov_notification(
BACNET_ADDRESS *src,
BACNET_CONFIRMED_SERVICE_DATA *service_data)
{
BACNET_NPDU_DATA npdu_data;
BACNET_COV_DATA cov_data;
BACNET_PROPERTY_VALUE property_value[MAX_COV_PROPERTIES];
BACNET_NPDU_DATA npdu_data = { 0 };
BACNET_COV_DATA cov_data = { 0 };
BACNET_PROPERTY_VALUE property_value[MAX_COV_PROPERTIES] = { 0 };
int len = 0;
int pdu_len = 0;
int bytes_sent = 0;
BACNET_ADDRESS my_address;
BACNET_ADDRESS my_address = { 0 };
/* create linked list to store data if more
than one property value is expected */
+8 -8
View File
@@ -193,7 +193,7 @@ static int cov_encode_subscription(
{
int len = 0;
int apdu_len = 0;
BACNET_OCTET_STRING octet_string;
BACNET_OCTET_STRING octet_string = { 0 };
BACNET_ADDRESS *dest = NULL;
(void)max_apdu;
@@ -447,12 +447,12 @@ static bool cov_send_request(
{
int len = 0;
int pdu_len = 0;
BACNET_NPDU_DATA npdu_data;
BACNET_ADDRESS my_address;
BACNET_NPDU_DATA npdu_data = { 0 };
BACNET_ADDRESS my_address = { 0 };
int bytes_sent = 0;
uint8_t invoke_id = 0;
bool status = false; /* return value */
BACNET_COV_DATA cov_data;
BACNET_COV_DATA cov_data = { 0 };
BACNET_ADDRESS *dest = NULL;
if (!dcc_communication_enabled()) {
@@ -615,7 +615,7 @@ bool handler_cov_fsm(void)
uint32_t object_instance = 0;
bool status = false;
bool send = false;
BACNET_PROPERTY_VALUE value_list[MAX_COV_PROPERTIES];
BACNET_PROPERTY_VALUE value_list[MAX_COV_PROPERTIES] = { 0 };
/* states for transmitting */
static enum {
COV_STATE_IDLE = 0,
@@ -806,15 +806,15 @@ void handler_cov_subscribe(
BACNET_ADDRESS *src,
BACNET_CONFIRMED_SERVICE_DATA *service_data)
{
BACNET_SUBSCRIBE_COV_DATA cov_data;
BACNET_SUBSCRIBE_COV_DATA cov_data = { 0 };
int len = 0;
int pdu_len = 0;
int npdu_len = 0;
int apdu_len = 0;
BACNET_NPDU_DATA npdu_data;
BACNET_NPDU_DATA npdu_data = { 0 };
bool success = false;
int bytes_sent = 0;
BACNET_ADDRESS my_address;
BACNET_ADDRESS my_address = { 0 };
bool error = false;
/* initialize a common abort code */