diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-18 14:07:35 +0300 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-02-01 04:20:25 +0300 |
commit | f2c043acfcf9dad9fd3d65821b81f89986bbe54e (patch) | |
tree | 0f15e9aacc83344443786d01cc78aaf5ff7899aa | |
parent | c30a5b13731919367ec2d781a107706fd00f21bc (diff) |
busybox: fix uninitialized memory when displaying IPv6 addresses
After commit 8e74adab0107658e3dc04ed342206272a284f43e
("libbb: make INET[6]_rresolve use sockaddr2{host,dotted}_noport")
INET_sprint6 uses more than just sin6_addr, it also tries to display the
scope id, which is uninitialized when called from ife_print6.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/interface.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/networking/interface.c b/networking/interface.c index 24bd13c57..e5723b428 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -881,6 +881,7 @@ static void ife_print6(struct interface *ptr) sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s", addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7]); + memset(&sap, 0, sizeof(sap)); inet_pton(AF_INET6, addr6, (struct sockaddr *) &sap.sin6_addr); sap.sin6_family = AF_INET6; |