]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation
authorShindo, Miki <miki.shindo@intel.com>
Tue, 19 Jul 2022 20:28:26 +0000 (04:28 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 21 Jul 2022 06:18:23 +0000 (06:18 +0000)
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>
EmulatorPkg/Unix/Host/PosixFileSystem.c

index ae3fe72a05d40f37dc2e028d8baf9ef061678783..b69d3d5520558168375079a65e4bf69a6758effd 100644 (file)
@@ -1187,7 +1187,7 @@ PosixFileSetInfo (
   }\r
 \r
   OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));\r
-  if (OldFileInfo == NULL) {\r
+  if (OldFileName == NULL) {\r
     goto Done;\r
   }\r
 \r