mirror of https://github.com/acidanthera/audk.git
ShellPkg/UefiShellLevel2CommandsLib: Handle the returned error
If this function fails in release build then the error was not handled and SourceHandle was not valid. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17184 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
14f3f88214
commit
2ce9792534
|
@ -170,8 +170,11 @@ CopySingleFile(
|
|||
//
|
||||
// open source file
|
||||
//
|
||||
Status = ShellOpenFileByName(Source, &SourceHandle, EFI_FILE_MODE_READ, 0);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
Status = ShellOpenFileByName (Source, &SourceHandle, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR (Status)) {
|
||||
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_CP_SRC_OPEN_FAIL), gShellLevel2HiiHandle, CmdName, Source);
|
||||
return (SHELL_ACCESS_DENIED);
|
||||
}
|
||||
|
||||
//
|
||||
//get file size of source file and freespace available on destination volume
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue