Skip to content

Commit ac51ec5

Browse files
author
Mika Leppänen
committed
Corrected coverity, compiler and astyle errors
1 parent 96c5496 commit ac51ec5

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

source/6LoWPAN/ws/ws_pae_auth.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,9 @@ void ws_pae_auth_slow_timer(uint16_t seconds)
579579

580580
pae_auth->slow_timer_seconds += seconds;
581581
if (pae_auth->slow_timer_seconds > 60) {
582-
ws_pae_lib_supp_list_slow_timer_update(&pae_auth->active_supp_list, pae_auth->timer_settings, pae_auth->slow_timer_seconds);
583-
ws_pae_lib_supp_list_slow_timer_update(&pae_auth->inactive_supp_list, pae_auth->timer_settings, pae_auth->slow_timer_seconds);
584-
pae_auth->slow_timer_seconds = 0;
582+
ws_pae_lib_supp_list_slow_timer_update(&pae_auth->active_supp_list, pae_auth->timer_settings, pae_auth->slow_timer_seconds);
583+
ws_pae_lib_supp_list_slow_timer_update(&pae_auth->inactive_supp_list, pae_auth->timer_settings, pae_auth->slow_timer_seconds);
584+
pae_auth->slow_timer_seconds = 0;
585585
}
586586
}
587587
}

source/6LoWPAN/ws/ws_pae_controller.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -677,12 +677,12 @@ int8_t ws_pae_controller_certificate_revocation_list_remove(const arm_cert_revoc
677677
sec_prot_certs_revocat_list_set(cert_revoc_list, crl->crl, crl->crl_len);
678678

679679
ns_list_foreach(pae_controller_t, entry, &pae_controller_list) {
680-
cert_revocat_list_entry_t *removed_cert_revoc_list = sec_prot_certs_revocat_lists_entry_find(&entry->certs.cert_revocat_lists, cert_revoc_list);
681-
if (removed_cert_revoc_list) {
682-
sec_prot_certs_revocat_lists_entry_delete(&entry->certs.cert_revocat_lists, removed_cert_revoc_list);
683-
ret = 0;
684-
}
685-
}
680+
cert_revocat_list_entry_t *removed_cert_revoc_list = sec_prot_certs_revocat_lists_entry_find(&entry->certs.cert_revocat_lists, cert_revoc_list);
681+
if (removed_cert_revoc_list) {
682+
sec_prot_certs_revocat_lists_entry_delete(&entry->certs.cert_revocat_lists, removed_cert_revoc_list);
683+
ret = 0;
684+
}
685+
}
686686

687687
sec_prot_certs_revocat_list_entry_delete(cert_revoc_list);
688688

source/6LoWPAN/ws/ws_pae_nvm_store.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ static int8_t ws_pae_nvm_store_read(const char *file_name, nvm_tlv_list_t *tlv_l
161161

162162
while (list_count-- > 0) {
163163
nvm_tlv_entry_t entry_header;
164+
memset(&entry_header, 0, sizeof(nvm_tlv_entry_t));
164165
n_bytes = fread(&entry_header.tag, 1, NVM_TLV_FIXED_LEN, fp);
165166
if (n_bytes != NVM_TLV_FIXED_LEN) {
166167
failure = true;

source/NWK_INTERFACE/protocol_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void core_timer_event_handle(uint16_t ticksUpdate)
342342
icmpv6_radv_timer(ticksUpdate);
343343
protocol_core_security_tick_update(ticksUpdate);
344344
#ifdef HAVE_WS
345-
ws_pae_controller_fast_timer(ticksUpdate);
345+
ws_pae_controller_fast_timer(ticksUpdate);
346346
#endif
347347
platform_enter_critical();
348348
protocol_core_timer_info.core_timer_event = false;

source/Security/protocols/sec_prot_keys.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void sec_prot_keys_gtkl_set(sec_prot_keys_t *sec_keys, uint8_t gtkl)
284284

285285
bool sec_prot_keys_gtkl_gtk_is_live(sec_prot_keys_t *sec_keys, uint8_t index)
286286
{
287-
if (index > GTK_NUM) {
287+
if (index >= GTK_NUM) {
288288
return false;
289289
}
290290

@@ -297,7 +297,7 @@ bool sec_prot_keys_gtkl_gtk_is_live(sec_prot_keys_t *sec_keys, uint8_t index)
297297

298298
int8_t sec_prot_keys_gtkl_gtk_live_set(sec_prot_keys_t *sec_keys, uint8_t index)
299299
{
300-
if (index > GTK_NUM) {
300+
if (index >= GTK_NUM) {
301301
return -1;
302302
}
303303

@@ -308,7 +308,7 @@ int8_t sec_prot_keys_gtkl_gtk_live_set(sec_prot_keys_t *sec_keys, uint8_t index)
308308

309309
int8_t sec_prot_keys_gtk_insert_index_set(sec_prot_keys_t *sec_keys, uint8_t index)
310310
{
311-
if (index > GTK_NUM || !sec_keys->gtks->gtk[index].set) {
311+
if (index >= GTK_NUM || !sec_keys->gtks->gtk[index].set) {
312312
return -1;
313313
}
314314

@@ -689,7 +689,7 @@ int8_t sec_prot_keys_gtk_install_order_second_index_get(sec_prot_gtk_keys_t *gtk
689689

690690
void sec_prot_keys_gtk_install_order_update(sec_prot_gtk_keys_t *gtks)
691691
{
692-
int8_t ordered_indexes[4] = {-1,-1,-1,-1};
692+
int8_t ordered_indexes[4] = {-1, -1, -1, -1};
693693

694694
// Creates table of ordered indexes
695695
for (uint8_t i = 0; i < GTK_NUM; i++) {

source/libNET/src/ns_net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ int8_t arm_network_certificate_revocation_list_add(const arm_cert_revocation_lis
969969
#ifdef HAVE_WS
970970
return ws_pae_controller_certificate_revocation_list_add(crl);
971971
#else
972-
(void) cert;
972+
(void) crl;
973973
return -1;
974974
#endif
975975
}
@@ -979,7 +979,7 @@ int8_t arm_network_certificate_revocation_list_remove(const arm_cert_revocation_
979979
#ifdef HAVE_WS
980980
return ws_pae_controller_certificate_revocation_list_remove(crl);
981981
#else
982-
(void) cert;
982+
(void) crl;
983983
return -1;
984984
#endif
985985
}

0 commit comments

Comments
 (0)