Skip to content

Commit a33413b

Browse files
committed
net/ip/native_socks: Fix not terminating name in native_sock_itf_getnext
mif_name is expected to be NULL terminated as it is used as string.
1 parent 6e0a53f commit a33413b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ip/native_sockets/src/native_itf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ native_sock_itf_getnext(struct mn_itf *mi)
7373
continue;
7474
}
7575
strncpy(mi->mif_name, ifa->ifa_name, sizeof(mi->mif_name));
76+
mi->mif_name[sizeof(mi->mif_name) - 1] = '\0';
7677
mi->mif_idx = cur_idx;
7778
mi->mif_flags = itf_flags(ifa->ifa_flags);
7879
rc = 0;

0 commit comments

Comments
 (0)