public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Shindo, Miki" <miki.shindo@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Andrew Fish <afish@apple.com>
Subject: Re: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation
Date: Wed, 20 Jul 2022 10:13:42 +0000	[thread overview]
Message-ID: <CY4PR11MB1622C4AA00421AB276F2DE678C8E9@CY4PR11MB1622.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220719202826.18300-1-miki.shindo@intel.com>

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Shindo, Miki <miki.shindo@intel.com>
> Sent: Wednesday, July 20, 2022 4:28 AM
> To: devel@edk2.groups.io
> Cc: Andrew Fish <afish@apple.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory
> allocation
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4001
> 
> This commit adds NULL check on memory allocation of the size
> for FileName in ASCII string format at PosixFileSetInfo().
> 
> Signed-off-by: Miki Shindo <miki.shindo@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>  EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c
> b/EmulatorPkg/Unix/Host/PosixFileSystem.c
> index ae3fe72a05..b69d3d5520 100644
> --- a/EmulatorPkg/Unix/Host/PosixFileSystem.c
> +++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c
> @@ -1187,7 +1187,7 @@ PosixFileSetInfo (
>    }
> 
> 
> 
>    OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
> 
> -  if (OldFileInfo == NULL) {
> 
> +  if (OldFileName == NULL) {
> 
>      goto Done;
> 
>    }
> 
> 
> 
> --
> 2.27.0.windows.1


      reply	other threads:[~2022-07-20 10:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 20:28 [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation Miki Shindo
2022-07-20 10:13 ` Ni, Ray [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=CY4PR11MB1622C4AA00421AB276F2DE678C8E9@CY4PR11MB1622.namprd11.prod.outlook.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