summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <[email protected]>2026-04-29 17:40:00 +0200
committerHeinrich Schuchardt <[email protected]>2026-05-05 16:29:08 +0200
commit28980318032ea19031f0a739221e24f1ad87a09c (patch)
tree7c9b8d1ca6dae16f8c6d5014a7d94df7d14815ab
parent57460fde4ba84d67de4066ee1141e89e8139ed23 (diff)
efi_loader: initialize variables in efi_dp_from_http()
When using lwIP, efi_dp_from_http() may fail to initialize ip or mask. Initialize the variables before the call. Addresses-Coverity-ID: 645840 - Uninitialized variables (UNINIT) Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]>
-rw-r--r--lib/efi_loader/efi_device_path.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index b3fb20b2501..9efb158f5dd 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -955,8 +955,8 @@ struct efi_device_path *efi_dp_from_http(const char *server, struct udevice *dev
efi_uintn_t uridp_len;
char *pos;
char tmp[128];
- struct efi_ipv4_address ip;
- struct efi_ipv4_address mask;
+ struct efi_ipv4_address ip = { .ip_addr = { 0, 0, 0, 0 } };
+ struct efi_ipv4_address mask = { .ip_addr = { 0, 0, 0, 0 } };
if ((server && strlen("http://") + strlen(server) + 1 > sizeof(tmp)) ||
(!server && IS_ENABLED(CONFIG_NET_LWIP)))