Skip to content

Commit 3acd3a4

Browse files
author
Arto Kinnunen
authored
Fix warnings found by cppcheck (ARMmbed#2605)
- ns_socket.c: Uninitialized variable: tcp_info - mac_security_mib.c: Possible null pointer dereference: device_info
1 parent d2f5347 commit 3acd3a4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/Core/ns_socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ int16_t socket_buffer_sendmsg(int8_t sid, buffer_t *buf, const struct ns_msghdr
11191119

11201120
#ifndef NO_TCP
11211121
if (socket_ptr->type == SOCKET_TYPE_STREAM) {
1122-
tcp_session_t *tcp_info = tcp_info(inet_pcb);
1122+
tcp_session_t *tcp_info = inet_pcb->session;
11231123
if (!tcp_info) {
11241124
tr_warn("No TCP session for cur Socket");
11251125
ret_val = -3;

source/MAC/IEEE802_15_4/mac_security_mib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ void mac_sec_mib_key_device_frame_counter_set(mlme_key_descriptor_t *key_descpri
600600
if (key_descpription_table->KeyFrameCounterPerKey) {
601601
uint32_t *counter_ptr = key_descpription_table->KeyDeviceFrameCounterList + attribute_index;
602602
*counter_ptr = frame_counter;
603-
} else {
603+
} else if (device_info) {
604604
device_info->FrameCounter = frame_counter;
605605
}
606606
}

0 commit comments

Comments
 (0)