]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: initialize variables in efi_dp_from_http()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 29 Apr 2026 15:40:00 +0000 (17:40 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 5 May 2026 14:29:08 +0000 (16:29 +0200)
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 <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_device_path.c

index b3fb20b2501ec68f68063eab71eb8bde56f7a9f4..9efb158f5dd6083c23f109de7d2353aa92062b53 100644 (file)
@@ -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)))