aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--interface.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 5e6d4b54..b026effb 100644
--- a/NEWS
+++ b/NEWS
@@ -54,6 +54,8 @@ fetchmail 6.3.10 (not yet released):
Details: http://blog.flameeyes.eu/2009/01/01/the-canonical-target
* Do not lose PS_MAXFETCH (13) exit status when hitting maxpoll. Reported by
Michelle Konzack, Debian Bug#508667.
+* Do not overlap source and destination fields in snprintf() in interface.c.
+ Courtesy of Nico Golde, Debian.
# TRANSLATION UPDATES AND ADDITIONS (ordered by language name):
* [it] Italian (Vincenzo Campanella)
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))
{