diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-07-02 11:01:38 +0100 |
---|---|---|
committer | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2025-07-03 11:32:49 +0300 |
commit | 9a64eecad675f99f1ddf14184433a46728f7e047 (patch) | |
tree | aaf14e9f3905147dbf86e2598111d8255ca667ca | |
parent | 5753dc3f6572d42057a262f0e57e904e5c9cd9bc (diff) |
efi_loader: Prevent free of uninitialised pointer
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.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r-- | lib/efi_loader/efi_net.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index 86f0af9538c..b8a6e08ba8e 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -1131,7 +1131,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) { |