[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] busybox: fix uninitialized memory when displaying IPv6 addresses
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2016-02-01 1:21:19
Message-ID: CAK1hOcMmqH+=EL_ViC9JPTTn5yBkCE188V_k8274Or72sGn3jA () mail ! gmail ! com
[Download RAW message or body]

Applied, thanks!

On Mon, Jan 18, 2016 at 12:07 PM, Felix Fietkau <nbd@openwrt.org> wrote:
> 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>
> ---
>  networking/interface.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/networking/interface.c b/networking/interface.c
> index 24bd13c..e5723b4 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;
> --
> 2.2.2
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic