[git commit] route: fix output of "route -n -A inet6"

Denys Vlasenko vda.linux at googlemail.com
Tue Oct 8 11:52:12 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=4527273f1c5bca044577f2f8ed2d7e4f203bf485
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

The output of the command "route -n -A inet6" may be corrupted
due to partially initialized structure snaddr6 in the function
INET6_displayroutes.

Signed-off-by: Tomas Paukrt <tomaspaukrt at email.cz>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/route.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/networking/route.c b/networking/route.c
index a5d8d7cb9..e785b1da6 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -628,6 +628,7 @@ static void INET6_displayroutes(void)
 
 		r = 0;
 		while (1) {
+			memset(&snaddr6, 0, sizeof(snaddr6));
 			inet_pton(AF_INET6, addr6x + r,
 					  (struct sockaddr *) &snaddr6.sin6_addr);
 			snaddr6.sin6_family = AF_INET6;


More information about the busybox-cvs mailing list