From a804c2b676aa9629bea657e78d5e6803b85228cc Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Tue, 6 Jan 2009 18:00:21 +0000 Subject: Fix: Do not overlap source and destination fields in snprintf() in interface.c. Courtesy of Nico Golde, Debian. svn path=/branches/BRANCH_6-3/; revision=5260 --- interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'interface.c') diff --git a/interface.c b/interface.c index c9a5db01..70e99ba9 100644 --- a/interface.c +++ b/interface.c @@ -271,7 +271,7 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo) { kvm_read(kvmfd, ifnet_addr, &ifnet, sizeof(ifnet)); kvm_read(kvmfd, (unsigned long) ifnet.if_name, tname, sizeof tname); - snprintf(tname, sizeof tname, "%s%d", tname, ifnet.if_unit); + snprintf(tname + strlen(tname), sizeof(tname) - strlen(tname), "%d", ifnet.if_unit); if (!strcmp(tname, iname)) { -- cgit v1.2.3