In the function grub_net_configure_by_dhcp_ack(),
grub_net_network_level_address_t addr is called but isn't being initialized. To
prevent contents of this structure from being filled with junk data from the
stack, we can initialize it to 0 by setting addr to {}.

Fixes: CID 375036

Signed-off-by: Alec Brown <alec.r.br...@oracle.com>
---
 grub-core/net/bootp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
index 6fb562702..708d601df 100644
--- a/grub-core/net/bootp.c
+++ b/grub-core/net/bootp.c
@@ -232,7 +232,7 @@ grub_net_configure_by_dhcp_ack (const char *name,
                                grub_size_t size,
                                int is_def, char **device, char **path)
 {
-  grub_net_network_level_address_t addr;
+  grub_net_network_level_address_t addr = {};
   grub_net_link_level_address_t hwaddr;
   struct grub_net_network_level_interface *inter;
   int mask = -1;
-- 
2.27.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to