Blame SOURCES/open-iscsi-2.0.876-6-Use-correct-size-when-copying-nic-name.patch

e88930
From 7fd4eb9313154f3b3458ea07d6a12f0be26d2a4e Mon Sep 17 00:00:00 2001
e88930
From: Lee Duncan <lduncan@suse.com>
e88930
Date: Wed, 21 Mar 2018 16:43:33 -0700
e88930
Subject: [PATCH] Use correct size when copying nic name.
e88930
e88930
The incorrect length was being used to copy
e88930
the NIC name.
e88930
e88930
Found by gcc-8, which gave this error:
e88930
>    [   19s] nic_utils.c: In function 'nic_util_enable_disable_multicast':
e88930
>    [   19s] nic_utils.c:308:9: warning: argument to 'sizeof' in 'strncpy'
e88930
>             call is the same expression as the source; did you mean to
e88930
>             use the size of the destination? [-Wsizeof-pointer-memaccess]
e88930
>    [   19s]    sizeof(nic->eth_device_name));
e88930
>    [   19s]          ^
e88930
---
e88930
 iscsiuio/src/unix/nic_utils.c | 2 +-
e88930
 1 file changed, 1 insertion(+), 1 deletion(-)
e88930
e88930
diff --git a/iscsiuio/src/unix/nic_utils.c b/iscsiuio/src/unix/nic_utils.c
e88930
index e2f294389840..786f2a4d5b5d 100644
e88930
--- a/iscsiuio/src/unix/nic_utils.c
e88930
+++ b/iscsiuio/src/unix/nic_utils.c
e88930
@@ -305,7 +305,7 @@ static int nic_util_enable_disable_multicast(nic_t *nic, uint32_t cmd)
e88930
 	/* Prepare the request */
e88930
 	memset(&ifr, 0, sizeof(ifr));
e88930
 	strncpy(ifr.ifr_name, nic->eth_device_name,
e88930
-		sizeof(nic->eth_device_name));
e88930
+		sizeof(ifr.ifr_name));
e88930
 	memcpy(ifr.ifr_hwaddr.sa_data, multicast_addr.addr, ETH_ALEN);
e88930
 
e88930
 	fd = socket(AF_INET, SOCK_DGRAM, 0);
e88930
-- 
e88930
2.17.2
e88930