From ed6ade043ddf5406821432935de74f007d1f73b9 Mon Sep 17 00:00:00 2001
From: Michael Tuexen <tuexen@fh-muenster.de>
Date: Sun, 8 Oct 2017 14:02:15 +0200
Subject: [PATCH] Fix CID 187175.

---
 gtests/net/packetdrill/netdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gtests/net/packetdrill/netdev.c b/gtests/net/packetdrill/netdev.c
index 39c21441..6dc334d8 100644
--- a/gtests/net/packetdrill/netdev.c
+++ b/gtests/net/packetdrill/netdev.c
@@ -274,7 +274,10 @@ static void bring_up_device(struct local_netdev *netdev)
 
 	assert(strlen(netdev->name) < IFNAMSIZ);
 	memset(&ifr, 0, sizeof(ifr));
-	strncpy(ifr.ifr_name, netdev->name, IFNAMSIZ);
+	if (strlen(netdev->name) < IFNAMSIZ)
+		strcpy(ifr.ifr_name, netdev->name);
+	else
+		die("interface name %s too long.\n", netdev->name);
 	if (ioctl(netdev->ipv4_control_fd, SIOCGIFFLAGS, &ifr) < 0)
 		die_perror("SIOCGIFFLAGS");
 	ifr.ifr_flags |= IFF_UP | IFF_RUNNING;
-- 
GitLab