goto Done;\r
}\r
VariableName = (CHAR16 *) ((UINTN) Entry + sizeof (*Entry));\r
- StrnCpy (VariableName, Name, StrLen (Name));\r
+ StrCpyS (VariableName, StrSize(Name)/sizeof(CHAR16), Name);\r
CopyGuid (&Entry->Guid, Guid);\r
CopyMem (&Entry->VariableProperty, VariableProperty, sizeof (*VariableProperty));\r
InsertTailList (&mVarCheckVariableList, &Entry->Link);\r