Skip to content

Commit 17eca62

Browse files
authored
nat46-netdev: Calling risky function (DC.CUSTOM_STRCPY) by Coverity
A false positive and we just ignore it.
1 parent 17e7168 commit 17eca62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nat46/modules/nat46-netdev.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ static int nat46_netdev_create(struct net *net, char *basename, struct net_devic
149149
snprintf(devname, strlen(NETDEV_DEFAULT_NAME)+3, "%s%d", NETDEV_DEFAULT_NAME, netdev_count);
150150
netdev_count++;
151151
} else {
152-
snprintf(devname, strlen(basename)+1, "%s", basename);
152+
/* coverity[dont_call] false positive + ignore */
153+
strcpy(devname, basename); /* In this particular case, we allocate the destination based on the source length, so the strcpy will be safe by construction - destination always has enough size to take the source in */
153154
}
154155

155156
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,17,0)

0 commit comments

Comments
 (0)