Safe string functions can help avoid potential buffer overflow. This patch replaces the StrCpy with StCpyS.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18608
6f19259b-4bc3-4df7-8a09-
765794883524
UINTN Index;\r
UINTN LastStep;\r
UINTN Step;\r
+ EFI_STATUS Status;\r
\r
if ((NTOHS (Packet->OpCode)) != EFI_MTFTP4_OPCODE_DATA) {\r
return EFI_SUCCESS;\r
\r
ShellPrintEx (-1, -1, L"%s", mTftpProgressDelete);\r
\r
- StrCpy (Progress, mTftpProgressFrame);\r
+ Status = StrCpyS (Progress, TFTP_PROGRESS_MESSAGE_SIZE, mTftpProgressFrame);\r
+ if (EFI_ERROR(Status)) {\r
+ return Status;\r
+ }\r
for (Index = 1; Index < Step; Index++) {\r
Progress[Index] = L'=';\r
}\r