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>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Shindo, Miki 2022-07-20 04:28:26 +08:00 committed by mergify[bot]
parent 3b8cee1781
commit 7ef91af84c
1 changed files with 1 additions and 1 deletions

View File

@ -1187,7 +1187,7 @@ PosixFileSetInfo (
}
OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
if (OldFileInfo == NULL) {
if (OldFileName == NULL) {
goto Done;
}