Archived
1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
archive/package/utils/busybox/patches/010-networking-fix-uninitialized-memory-when-displaying-.patch
Felix Fietkau b0684dafa3 treewide: fix replace nbd@openwrt.org with nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>

SVN-Revision: 49379
2016-06-07 06:59:36 +00:00

24 lines
873 B
Diff

From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 18 Jan 2016 12:03:45 +0100
Subject: [PATCH] networking: 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@nbd.name>
---
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -881,6 +881,7 @@ static void ife_print6(struct interface
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;