From 7ef91af84c04b1e5a17631bd1811c9bc1945dfdc Mon Sep 17 00:00:00 2001 From: "Shindo, Miki" Date: Wed, 20 Jul 2022 04:28:26 +0800 Subject: 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 Cc: Andrew Fish Reviewed-by: Ray Ni --- EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'EmulatorPkg/Unix') diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c b/EmulatorPkg/Unix/Host/PosixFileSystem.c index ae3fe72..b69d3d5 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; } -- cgit v1.1