[PATCH v2 0/7] Fix coverity uninitialized scalar variable bugs in grub-core

2022-03-20 Thread Alec Brown
v2: Set structs with multiple uninitialized members to {0} and set single uninitialized members to 0. Coverity identified multiple uninitialized scalar variable bugs in multiple components of the grub-core. These patches address these issues. The Coverity bugs being addressed are: CID 375026 CID

[PATCH v2 3/7] grub-core/net/arp.c: Fix uninitialized scalar variable

2022-03-20 Thread Alec Brown
In the function grub_net_arp_receive(), grub_net_network_level_address_t sender_addr and target_addr are being called but aren't being initialized. In both of these structs, each member is being set to a value except for grub_dns_option_t option. This results in this member being filled with junk d

[PATCH v2 4/7] grub-core/loader/i386/xnu.c: Fix uninitialized scalar variable

2022-03-20 Thread Alec Brown
In the function grub_xnu_boot_resume(), struct grub_relocator32_state state is called but isn't being initialized. This results in the members grub_uint32_t ebx, grub_uint32_t ecx, grub_uint32_t edx, grub_uint32_t esi, and grub_uint32_t edi being filled with junk data from the stack since none of t

[PATCH v2 5/7] grub-core/net/net.c: Fix uninitialized scalar variable

2022-03-20 Thread Alec Brown
In the function grub_net_ipv6_get_link_local(), grub_net_network_level_address_t addr is called but isn't being initialized. This results in the member grub_dns_option_t option being filled with junk data from the stack. We can prevent this by setting the option member in addr to 0. Fixes: CID 375

[PATCH v2 7/7] grub-core/net/bootp.c: Fix uninitialized scalar variable

2022-03-20 Thread Alec Brown
In the function grub_net_configure_by_dhcp_ack(), grub_net_network_level_address_t addr is called but isn't being initialized. This results in the member grub_dns_option_t option being filled with junk data from the stack. To prevent this, we can set the option member in addr to 0. Fixes: CID 3750

[PATCH v2 1/7] grub-core/loader/i386/bsd.c: Fix uninitialized scalar variable

2022-03-20 Thread Alec Brown
In the function grub_netbsd_setup_video(), struct grub_netbsd_btinfo_framebuf params is called but isn't being initialized. The member grub_uint8_t reserved[16] isn't set to any values and is instead filled with junk data from the stack. We can prevent this by setting params to {0}. Fixes: CID 375

[PATCH v2 2/7] grub-core/loader/i386/pc/linux.c: Fix uninitialized scalar variable

2022-03-20 Thread Alec Brown
In the function grub_linux16_boot(), struct grub_relocator16_state state is called but isn't being initialized. This results in the members grub_uint32_t ebx, grub_uint32_t edx, grub_uint32_t esi, and grub_uint32_t ebp being filled with junk data from the stack since none of them are being set to a

[PATCH v2 6/7] grub-core/loader/i386/xnu.c: Fix uninitialized scalar variable

2022-03-20 Thread Alec Brown
In the function grub_xnu_boot(), struct grub_relocator32_state state is called but isn't being initialized. This results in the members grub_uint32_t ebx, grub_uint32_t ecx, grub_uint32_t edx, grub_uint32_t edi, and grub_uint32_t esi being filled with junk data from the stack since none of them are