summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellTftpCommandLib
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellTftpCommandLib')
-rw-r--r--ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
index 6561270df5..666ee9d8ea 100644
--- a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
+++ b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
@@ -272,6 +272,7 @@ ShellCommandRunTftp (
CONST CHAR16 *ValueStr;
CONST CHAR16 *RemoteFilePath;
CHAR8 *AsciiRemoteFilePath;
+ UINTN FilePathSize;
CONST CHAR16 *Walker;
CONST CHAR16 *LocalFilePath;
EFI_MTFTP4_CONFIG_DATA Mtftp4ConfigData;
@@ -358,14 +359,13 @@ ShellCommandRunTftp (
RemoteFilePath = ShellCommandLineGetRawValue (CheckPackage, 2);
ASSERT(RemoteFilePath != NULL);
- AsciiRemoteFilePath = AllocatePool (
- (StrLen (RemoteFilePath) + 1) * sizeof (CHAR8)
- );
+ FilePathSize = StrLen (RemoteFilePath) + 1;
+ AsciiRemoteFilePath = AllocatePool (FilePathSize);
if (AsciiRemoteFilePath == NULL) {
ShellStatus = SHELL_OUT_OF_RESOURCES;
goto Error;
}
- UnicodeStrToAsciiStr (RemoteFilePath, AsciiRemoteFilePath);
+ UnicodeStrToAsciiStrS (RemoteFilePath, AsciiRemoteFilePath, FilePathSize);
if (ParamCount == 4) {
LocalFilePath = ShellCommandLineGetRawValue (CheckPackage, 3);