From: "Gao, Liming" <liming.gao@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] MdeModulePkg/HiiDataBase: Fix NULL deference bug in HiiGetImageInfo
Date: Fri, 30 Sep 2016 05:36:52 +0000 [thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B47F035@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20160930043113.541636-1-ruiyu.ni@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Friday, September 30, 2016 12:31 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH] MdeModulePkg/HiiDataBase: Fix NULL deference bug in
> HiiGetImageInfo
>
> The return value of GetImageIdOrAddress() could be NULL if the
> ImageId is invalid. The patch fixes the bug to return EFI_NOT_FOUND
> when GetImageIdOrAddress() returns NULL.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> ---
> MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c
> index 1e3f3bd..33dbc7d 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ImageEx.c
> @@ -361,6 +361,10 @@ HiiGetImageInfo (
> // Find the image block specified by ImageId
> //
> CurrentImageBlock = GetImageIdOrAddress (ImagePackage->ImageBlock,
> &ImageId);
> + if (CurrentImageBlock == NULL) {
> + return EFI_NOT_FOUND;
> + }
> +
> switch (CurrentImageBlock->BlockType) {
> case EFI_HII_IIBT_IMAGE_JPEG:
> case EFI_HII_IIBT_IMAGE_PNG:
> --
> 2.9.0.windows.1
prev parent reply other threads:[~2016-09-30 5:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 4:31 [PATCH] MdeModulePkg/HiiDataBase: Fix NULL deference bug in HiiGetImageInfo Ruiyu Ni
2016-09-30 5:36 ` Gao, Liming [this message]
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-list 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=4A89E2EF3DFEDB4C8BFDE51014F606A14B47F035@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox