summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg
diff options
context:
space:
mode:
authorShindo, Miki <miki.shindo@intel.com>2022-07-20 04:28:26 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-07-21 06:18:23 +0000
commit7ef91af84c04b1e5a17631bd1811c9bc1945dfdc (patch)
treece68a79a16beed6985f95475233bcb7b40f988a2 /EmulatorPkg
parent3b8cee1781c4149c7a762b8a1c8115b635cf4cad (diff)
downloadedk2-7ef91af84c04b1e5a17631bd1811c9bc1945dfdc.tar.gz
edk2-7ef91af84c04b1e5a17631bd1811c9bc1945dfdc.tar.bz2
edk2-7ef91af84c04b1e5a17631bd1811c9bc1945dfdc.zip
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>
Diffstat (limited to 'EmulatorPkg')
-rw-r--r--EmulatorPkg/Unix/Host/PosixFileSystem.c2
1 files changed, 1 insertions, 1 deletions
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;
}