diff options
author | alekhgupta1441 <alekhgupta1441@gmail.com> | 2020-04-18 18:04:58 +0530 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-05-05 13:17:37 -0400 |
commit | 613ad6900db6b66248a7a497c22e9c277d7e238e (patch) | |
tree | 2657101b0e2916c40c04355834179cb3eb253db7 | |
parent | 941c6c895a5724c142cfb0a32220885062373d57 (diff) |
gr-blocks: Fixed strncpy warning in tuntap_pdu_impl
-rw-r--r-- | gr-blocks/lib/tuntap_pdu_impl.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gr-blocks/lib/tuntap_pdu_impl.cc b/gr-blocks/lib/tuntap_pdu_impl.cc index e5e7569077..e333e40bdd 100644 --- a/gr-blocks/lib/tuntap_pdu_impl.cc +++ b/gr-blocks/lib/tuntap_pdu_impl.cc @@ -151,6 +151,7 @@ int tuntap_pdu_impl::set_mtu(const char* dev, int MTU) /* preparation of the struct ifr, of type "struct ifreq" */ memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, dev, IFNAMSIZ); + ifr.ifr_name[IFNAMSIZ - 1] = '\0'; ifr.ifr_addr.sa_family = AF_INET; /* address family */ ifr.ifr_mtu = MTU; |