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
TftpError->OpCode = HTONS (EFI_MTFTP6_OPCODE_ERROR);\r
TftpError->Error.ErrorCode = HTONS (ErrCode);\r
\r
- AsciiStrCpyS ((CHAR8 *) TftpError->Error.ErrorMessage, sizeof (TftpError->Error.ErrorMessage) / sizeof (TftpError->Error.ErrorMessage[0]), (CHAR8 *) ErrInfo);\r
+ AsciiStrCpyS ((CHAR8 *) TftpError->Error.ErrorMessage, AsciiStrLen ((CHAR8 *) ErrInfo) + 1 , (CHAR8 *) ErrInfo);\r
\r
//\r
// Save the packet buf for retransmit\r