From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>, u-boot@lists.denx.de
Subject: Re: [PATCH] efi_loader: fix uninitialized variable bug in efi_set_load_options()
Date: Thu, 27 Jul 2023 11:23:13 +0300 [thread overview]
Message-ID: <ZMIpcSUgmd0ptrye@hades> (raw)
In-Reply-To: <e5f60d0e-e1ee-46e1-b0ec-fdda7011ee82@moroto.mountain>
On Thu, Jul 27, 2023 at 10:15:01AM +0300, Dan Carpenter wrote:
> Check for efi_search_protocol() failure before dereferencing "handler"
> to avoid a crash.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> lib/efi_loader/efi_load_options.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_load_options.c b/lib/efi_loader/efi_load_options.c
> index 3cfddee014e9..5f62184da1cd 100644
> --- a/lib/efi_loader/efi_load_options.c
> +++ b/lib/efi_loader/efi_load_options.c
> @@ -31,10 +31,10 @@ efi_status_t efi_set_load_options(efi_handle_t handle,
> efi_status_t ret;
>
> ret = efi_search_protocol(handle, &efi_guid_loaded_image, &handler);
> - loaded_image_info = handler->protocol_interface;
> if (ret != EFI_SUCCESS)
> return EFI_INVALID_PARAMETER;
>
> + loaded_image_info = handler->protocol_interface;
> loaded_image_info->load_options = load_options;
> loaded_image_info->load_options_size = load_options_size;
>
> --
> 2.39.2
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
next prev parent reply other threads:[~2023-07-27 8:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 7:15 [PATCH] efi_loader: fix uninitialized variable bug in efi_set_load_options() Dan Carpenter
2023-07-27 8:23 ` Ilias Apalodimas [this message]
2023-07-27 8:27 ` Heinrich Schuchardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZMIpcSUgmd0ptrye@hades \
--to=ilias.apalodimas@linaro.org \
--cc=dan.carpenter@linaro.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.