Skip to content

Commit

Permalink
fix warning about ifr_name size
Browse files Browse the repository at this point in the history
Signed-off-by: R4SAS <[email protected]>
  • Loading branch information
r4sas committed Aug 23, 2021
1 parent 96850da commit 455c71f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libi2pd/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ namespace net
if(fd > 0)
{
ifreq ifr;
strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); // set interface for query
strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ-1); // set interface for query
if(ioctl(fd, SIOCGIFMTU, &ifr) >= 0)
mtu = ifr.ifr_mtu; // MTU
else
Expand Down

0 comments on commit 455c71f

Please sign in to comment.