grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH resend] ofnet: Initialize structs in bootpath parser


From: Paul Menzel
Subject: Re: [PATCH resend] ofnet: Initialize structs in bootpath parser
Date: Fri, 24 Aug 2018 22:38:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1


On 08/23/18 14:12, Julian Andres Klode wrote:
> Code later on checks if variables inside the struct are
> 0 to see if they have been set, like if there were addresses
> in the bootpath.
> 
> The variables were not initialized however, so the check
> might suceed with uninitialized data, and a new interface

succeed

> with random addresses has been added. This caused a weird

is added (I’d use present tense to describe a problem.)
This causes

> bug in Ubuntu, because when booting from network, we now
> had two interfaces with the same name, and net_default_mac

have

> pointed to the random one.

points

> Bug-Ubuntu: https://bugs.launchpad.net/bugs/1785859
> Signed-off-by: Julian Andres Klode <address@hidden>
> ---
>  grub-core/net/drivers/ieee1275/ofnet.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/grub-core/net/drivers/ieee1275/ofnet.c 
> b/grub-core/net/drivers/ieee1275/ofnet.c
> index 002446be1..00abc64bb 100644
> --- a/grub-core/net/drivers/ieee1275/ofnet.c
> +++ b/grub-core/net/drivers/ieee1275/ofnet.c
> @@ -153,8 +153,8 @@ grub_ieee1275_parse_bootpath (const char *devpath, char 
> *bootpath,
>    char *comma_char = 0;
>    char *equal_char = 0;
>    grub_size_t field_counter = 0;
> -  grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask;
> -  grub_net_link_level_address_t hw_addr;
> +  grub_net_network_level_address_t client_addr = {}, gateway_addr = {}, 
> subnet_mask = {};
> +  grub_net_link_level_address_t hw_addr = {};
>    grub_net_interface_flags_t flags = 0;
>    struct grub_net_network_level_interface *inter = NULL;
>    grub_uint16_t vlantag = 0;

The diff looks good.


Kind regards,

Paul

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]