[PATCH perftest 22/23] multicast_resources: use strncpy() to prevent overflow possibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



CC: Gil Rockah <gilr@xxxxxxxxxxxx>
Signed-off-by: Jarod Wilson <jarod@xxxxxxxxxx>
---
 src/multicast_resources.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/multicast_resources.c b/src/multicast_resources.c
index 3a8edba..f5e4bea 100755
--- a/src/multicast_resources.c
+++ b/src/multicast_resources.c
@@ -160,7 +160,7 @@ void set_multicast_gid(struct mcast_parameters *params,uint32_t qp_num,int is_cl
 		}
 		pstr += term - pstr + 1;
 
-		strcpy(tmp, pstr);
+		strncpy(tmp, pstr, sizeof(tmp) - 1);
 		mcg_gid[15] = (unsigned char)strtoll(tmp, NULL, 0);
 	}
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux