Skip to content

Commit 5db329a

Browse files
committed
lxc/network: null-terminate ifname string in lxc_network_recv_name_and_ifindex_from_child()
Fixes: Coverity 1486538 Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
1 parent 23633ab commit 5db329a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/lxc/network.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4183,6 +4183,7 @@ int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *handler)
41834183
ret = lxc_recv_nointr(data_sock, netdev->name, IFNAMSIZ, 0);
41844184
if (ret < 0)
41854185
return -1;
4186+
netdev->name[IFNAMSIZ-1] = '\0';
41864187

41874188
/* Receive network device ifindex in the child's namespace to
41884189
* parent.

0 commit comments

Comments
 (0)