[PATCH 3/3] efi_loader: Prevent free of uninitialised pointer
Andrew Goodbody
andrew.goodbody at linaro.org
Tue Jul 1 15:38:24 CEST 2025
Taking a goto to out_of_resources before receive_lengths is assigned
will result in an attempt to free an unitialised pointer. Instead
initialise receive_lengths to NULL on declaration to prevent this from
occurring.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
lib/efi_loader/efi_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index 8e708d8d350..3d092523dd5 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -1130,7 +1130,7 @@ efi_status_t efi_net_register(struct udevice *dev)
struct efi_net_obj *netobj;
void *transmit_buffer = NULL;
uchar **receive_buffer = NULL;
- size_t *receive_lengths;
+ size_t *receive_lengths = NULL;
int i, j;
if (!dev) {
--
2.39.5
More information about the U-Boot
mailing list