From: "Miki Shindo" <miki.shindo@intel.com>
To: devel@edk2.groups.io
Cc: Andrew Fish <afish@apple.com>, Ray Ni <ray.ni@intel.com>
Subject: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation
Date: Tue, 19 Jul 2022 13:28:26 -0700 [thread overview]
Message-ID: <20220719202826.18300-1-miki.shindo@intel.com> (raw)
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
next reply other threads:[~2022-07-19 20:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 20:28 Miki Shindo [this message]
2022-07-20 10:13 ` [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation Ni, Ray
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=20220719202826.18300-1-miki.shindo@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