Skip to content

Commit

Permalink
Fix warnings found by cppcheck (ARMmbed#2605)
Browse files Browse the repository at this point in the history
- ns_socket.c: Uninitialized variable: tcp_info
- mac_security_mib.c: Possible null pointer dereference: device_info
  • Loading branch information
Arto Kinnunen authored Apr 7, 2021
1 parent d2f5347 commit 3acd3a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/Core/ns_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ int16_t socket_buffer_sendmsg(int8_t sid, buffer_t *buf, const struct ns_msghdr

#ifndef NO_TCP
if (socket_ptr->type == SOCKET_TYPE_STREAM) {
tcp_session_t *tcp_info = tcp_info(inet_pcb);
tcp_session_t *tcp_info = inet_pcb->session;
if (!tcp_info) {
tr_warn("No TCP session for cur Socket");
ret_val = -3;
Expand Down
2 changes: 1 addition & 1 deletion source/MAC/IEEE802_15_4/mac_security_mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ void mac_sec_mib_key_device_frame_counter_set(mlme_key_descriptor_t *key_descpri
if (key_descpription_table->KeyFrameCounterPerKey) {
uint32_t *counter_ptr = key_descpription_table->KeyDeviceFrameCounterList + attribute_index;
*counter_ptr = frame_counter;
} else {
} else if (device_info) {
device_info->FrameCounter = frame_counter;
}
}
Expand Down

0 comments on commit 3acd3a4

Please sign in to comment.