Skip to content

Commit

Permalink
Fix coverity issues for 2.7 release
Browse files Browse the repository at this point in the history
Ref: NCSDK-27702

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
  • Loading branch information
ahasztag committed Jun 12, 2024
1 parent dcb8400 commit 4505925
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/suit.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ int suit_processor_get_manifest_metadata(const uint8_t *envelope_str, size_t env
}

if (ret == SUIT_SUCCESS) {
struct SUIT_Digest digest_cbor;
size_t bytes_processed;
struct SUIT_Digest digest_cbor = {0};
size_t bytes_processed = 0;
struct zcbor_string *digest_bstr = &decoder_state->manifest_digest_bytes;

ret = cbor_decode_SUIT_Digest(digest_bstr->value, digest_bstr->len, &digest_cbor,
Expand Down
4 changes: 2 additions & 2 deletions src/suit_condition.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ int suit_condition_device_identifier(struct suit_processor_state *state,
int suit_condition_image_match(struct suit_processor_state *state,
struct suit_manifest_params *component_params)
{
struct SUIT_Digest digest;
size_t bytes_processed;
struct SUIT_Digest digest = {0};
size_t bytes_processed = 0;

if (!component_params->image_digest_set) {
SUIT_ERR("Failed to check image digest: digest not set (handle: %p)\r\n", (void *)component_params->component_handle);
Expand Down
6 changes: 3 additions & 3 deletions src/suit_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ static int verify_suit_digest(struct SUIT_Digest *digest, struct zcbor_string *d

static int cose_verify_digest(struct zcbor_string *digest_bstr, struct zcbor_string *data_bstr)
{
struct SUIT_Digest digest;
size_t bytes_processed;
struct SUIT_Digest digest = {0};
size_t bytes_processed = 0;

int ret = cbor_decode_SUIT_Digest(digest_bstr->value, digest_bstr->len, &digest, &bytes_processed);

Expand All @@ -85,7 +85,7 @@ static int cose_sign1_authenticate_digest(struct zcbor_string *manifest_componen
size_t signed_data_size = 0;

/* Decode COSE_Sign1 structure */
struct COSE_Sign1 cose_sign1_struct;
struct COSE_Sign1 cose_sign1_struct = {0};
size_t cose_sign1_struct_size = 0;

int ret = cbor_decode_COSE_Sign1_Tagged(
Expand Down
2 changes: 1 addition & 1 deletion src/suit_seq_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ int suit_seq_exec_schedule(struct suit_processor_state *state, struct suit_manif

int suit_seq_exec_step(struct suit_processor_state *state)
{
suit_command_t command;
suit_command_t command = {0};
size_t decoded_len = 0;
struct suit_seq_exec_state *seq_exec_state = NULL;

Expand Down

0 comments on commit 4505925

Please sign in to comment.