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:
committed by
mergify[bot]
parent
3b8cee1781
commit
7ef91af84c
@ -1187,7 +1187,7 @@ PosixFileSetInfo (
|
|||||||
}
|
}
|
||||||
|
|
||||||
OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
|
OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
|
||||||
if (OldFileInfo == NULL) {
|
if (OldFileName == NULL) {
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user