summaryrefslogtreecommitdiff
path: root/NetworkPkg/Mtftp6Dxe
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2015-08-05 03:25:20 +0000
committerluobozhang <luobozhang@Edk2>2015-08-05 03:25:20 +0000
commitb89ef37122c4e4472567be8a24a6461d0b1325a0 (patch)
treebd8bf1bb1b79d350846674a3a829471be1c789fb /NetworkPkg/Mtftp6Dxe
parenta3f28ac92c6aa90e91e44d3993378dc38c66841e (diff)
downloadedk2-platforms-b89ef37122c4e4472567be8a24a6461d0b1325a0.tar.xz
NetworkPkg: Fix assert caused by wrong parameter in AsciiStrCpyS()
The 2nd parameter in AsciiStrCpyS() should be the max available memory of the destination. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18161 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/Mtftp6Dxe')
-rw-r--r--NetworkPkg/Mtftp6Dxe/Mtftp6Support.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c b/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c
index 20888e8525..c31fc9dc27 100644
--- a/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c
+++ b/NetworkPkg/Mtftp6Dxe/Mtftp6Support.c
@@ -602,7 +602,7 @@ Mtftp6SendError (
TftpError->OpCode = HTONS (EFI_MTFTP6_OPCODE_ERROR);
TftpError->Error.ErrorCode = HTONS (ErrCode);
- AsciiStrCpyS ((CHAR8 *) TftpError->Error.ErrorMessage, sizeof (TftpError->Error.ErrorMessage) / sizeof (TftpError->Error.ErrorMessage[0]), (CHAR8 *) ErrInfo);
+ AsciiStrCpyS ((CHAR8 *) TftpError->Error.ErrorMessage, AsciiStrLen ((CHAR8 *) ErrInfo) + 1 , (CHAR8 *) ErrInfo);
//
// Save the packet buf for retransmit