CONST CHAR16 *ValueStr;\r
CONST CHAR16 *RemoteFilePath;\r
CHAR8 *AsciiRemoteFilePath;\r
+ UINTN FilePathSize;\r
CONST CHAR16 *Walker;\r
CONST CHAR16 *LocalFilePath;\r
EFI_MTFTP4_CONFIG_DATA Mtftp4ConfigData;\r
goto Error;\r
}\r
\r
- Mtftp4ConfigData = DefaultMtftp4ConfigData;\r
+ CopyMem (&Mtftp4ConfigData, &DefaultMtftp4ConfigData, sizeof (EFI_MTFTP4_CONFIG_DATA));\r
\r
//\r
// Check the host IPv4 address\r
\r
RemoteFilePath = ShellCommandLineGetRawValue (CheckPackage, 2);\r
ASSERT(RemoteFilePath != NULL);\r
- AsciiRemoteFilePath = AllocatePool (\r
- (StrLen (RemoteFilePath) + 1) * sizeof (CHAR8)\r
- );\r
+ FilePathSize = StrLen (RemoteFilePath) + 1;\r
+ AsciiRemoteFilePath = AllocatePool (FilePathSize);\r
if (AsciiRemoteFilePath == NULL) {\r
ShellStatus = SHELL_OUT_OF_RESOURCES;\r
goto Error;\r
}\r
- UnicodeStrToAsciiStr (RemoteFilePath, AsciiRemoteFilePath);\r
+ UnicodeStrToAsciiStrS (RemoteFilePath, AsciiRemoteFilePath, FilePathSize);\r
\r
if (ParamCount == 4) {\r
LocalFilePath = ShellCommandLineGetRawValue (CheckPackage, 3);\r