Fixed the use of uninitialized values in COV handlers. (#1049)
This commit is contained in:
@@ -127,13 +127,13 @@ void handler_ccov_notification(
|
|||||||
BACNET_ADDRESS *src,
|
BACNET_ADDRESS *src,
|
||||||
BACNET_CONFIRMED_SERVICE_DATA *service_data)
|
BACNET_CONFIRMED_SERVICE_DATA *service_data)
|
||||||
{
|
{
|
||||||
BACNET_NPDU_DATA npdu_data;
|
BACNET_NPDU_DATA npdu_data = { 0 };
|
||||||
BACNET_COV_DATA cov_data;
|
BACNET_COV_DATA cov_data = { 0 };
|
||||||
BACNET_PROPERTY_VALUE property_value[MAX_COV_PROPERTIES];
|
BACNET_PROPERTY_VALUE property_value[MAX_COV_PROPERTIES] = { 0 };
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int pdu_len = 0;
|
int pdu_len = 0;
|
||||||
int bytes_sent = 0;
|
int bytes_sent = 0;
|
||||||
BACNET_ADDRESS my_address;
|
BACNET_ADDRESS my_address = { 0 };
|
||||||
|
|
||||||
/* create linked list to store data if more
|
/* create linked list to store data if more
|
||||||
than one property value is expected */
|
than one property value is expected */
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ static int cov_encode_subscription(
|
|||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int apdu_len = 0;
|
int apdu_len = 0;
|
||||||
BACNET_OCTET_STRING octet_string;
|
BACNET_OCTET_STRING octet_string = { 0 };
|
||||||
BACNET_ADDRESS *dest = NULL;
|
BACNET_ADDRESS *dest = NULL;
|
||||||
|
|
||||||
(void)max_apdu;
|
(void)max_apdu;
|
||||||
@@ -447,12 +447,12 @@ static bool cov_send_request(
|
|||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int pdu_len = 0;
|
int pdu_len = 0;
|
||||||
BACNET_NPDU_DATA npdu_data;
|
BACNET_NPDU_DATA npdu_data = { 0 };
|
||||||
BACNET_ADDRESS my_address;
|
BACNET_ADDRESS my_address = { 0 };
|
||||||
int bytes_sent = 0;
|
int bytes_sent = 0;
|
||||||
uint8_t invoke_id = 0;
|
uint8_t invoke_id = 0;
|
||||||
bool status = false; /* return value */
|
bool status = false; /* return value */
|
||||||
BACNET_COV_DATA cov_data;
|
BACNET_COV_DATA cov_data = { 0 };
|
||||||
BACNET_ADDRESS *dest = NULL;
|
BACNET_ADDRESS *dest = NULL;
|
||||||
|
|
||||||
if (!dcc_communication_enabled()) {
|
if (!dcc_communication_enabled()) {
|
||||||
@@ -615,7 +615,7 @@ bool handler_cov_fsm(void)
|
|||||||
uint32_t object_instance = 0;
|
uint32_t object_instance = 0;
|
||||||
bool status = false;
|
bool status = false;
|
||||||
bool send = false;
|
bool send = false;
|
||||||
BACNET_PROPERTY_VALUE value_list[MAX_COV_PROPERTIES];
|
BACNET_PROPERTY_VALUE value_list[MAX_COV_PROPERTIES] = { 0 };
|
||||||
/* states for transmitting */
|
/* states for transmitting */
|
||||||
static enum {
|
static enum {
|
||||||
COV_STATE_IDLE = 0,
|
COV_STATE_IDLE = 0,
|
||||||
@@ -806,15 +806,15 @@ void handler_cov_subscribe(
|
|||||||
BACNET_ADDRESS *src,
|
BACNET_ADDRESS *src,
|
||||||
BACNET_CONFIRMED_SERVICE_DATA *service_data)
|
BACNET_CONFIRMED_SERVICE_DATA *service_data)
|
||||||
{
|
{
|
||||||
BACNET_SUBSCRIBE_COV_DATA cov_data;
|
BACNET_SUBSCRIBE_COV_DATA cov_data = { 0 };
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int pdu_len = 0;
|
int pdu_len = 0;
|
||||||
int npdu_len = 0;
|
int npdu_len = 0;
|
||||||
int apdu_len = 0;
|
int apdu_len = 0;
|
||||||
BACNET_NPDU_DATA npdu_data;
|
BACNET_NPDU_DATA npdu_data = { 0 };
|
||||||
bool success = false;
|
bool success = false;
|
||||||
int bytes_sent = 0;
|
int bytes_sent = 0;
|
||||||
BACNET_ADDRESS my_address;
|
BACNET_ADDRESS my_address = { 0 };
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
/* initialize a common abort code */
|
/* initialize a common abort code */
|
||||||
|
|||||||
Reference in New Issue
Block a user