lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu,  6 Aug 2015 14:24:31 +0200
From:	Phil Sutter <phil@....cc>
To:	Stephen Hemminger <shemming@...cade.com>
Cc:	netdev@...r.kernel.org
Subject: [PATCH 1/6] ip/ipnetns: prevent potential string buffer overflow

Signed-off-by: Phil Sutter <phil@....cc>
---
 ip/ipnetns.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 3b704a4..32b0f51 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -178,7 +178,8 @@ static int netns_map_add(int nsid, char *name)
 		return -ENOMEM;
 	}
 	c->nsid = nsid;
-	strcpy(c->name, name);
+	strncpy(c->name, name, NAME_MAX);
+	c->name[NAME_MAX - 1] = '\0';
 
 	h = NSID_HASH_NSID(nsid);
 	hlist_add_head(&c->nsid_hash, &nsid_head[h]);
-- 
2.1.2

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ