Skip to content
Snippets Groups Projects
Commit 88042616 authored by DONG Anyuan's avatar DONG Anyuan
Browse files

Fix Coverity Scan CID 140733 (Calling strncpy with a maximum size argument of...

Fix Coverity Scan CID 140733 (Calling strncpy with a maximum size argument of 16 bytes on destination array ifr.ifr_ifrn.ifrn_name of size 16 bytes might leave the destination string unterminated.)
parent 8fe94b2f
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,7 @@ static int tun_alloc(char *dev) {
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
if( *dev )
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)-1);
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
close(fd);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment