if (Cwd == NULL) {\r
return (NULL);\r
}\r
- Size = StrSize(Cwd);\r
- Size += StrSize(Path);\r
+ Size = StrSize(Cwd) + StrSize(Path) - sizeof(CHAR16);\r
NewPath = AllocateZeroPool(Size);\r
if (NewPath == NULL) {\r
return (NULL);\r
}\r
- StrCpy(NewPath, Cwd);\r
+ StrnCpy(NewPath, Cwd, Size/sizeof(CHAR16)-1);\r
if (*Path == L'\\') {\r
Path++;\r
while (PathRemoveLastItem(NewPath)) ;\r
}\r
- StrCat(NewPath, Path);\r
+ StrnCat(NewPath, Path, Size/sizeof(CHAR16) - 1 - StrLen(NewPath));\r
DevicePathForReturn = EfiShellGetDevicePathFromFilePath(NewPath);\r
FreePool(NewPath);\r
return (DevicePathForReturn);\r
if (NewNode == NULL) {\r
return (NULL);\r
}\r
- NewNode->FullName = AllocateZeroPool(StrSize(Node->FullName));\r
-\r
- NewNode->FileName = AllocateZeroPool(StrSize(Node->FileName));\r
- NewNode->Info = AllocateZeroPool((UINTN)Node->Info->Size);\r
+ NewNode->FullName = AllocateCopyPool(StrSize(Node->FullName), Node->FullName);\r
+ NewNode->FileName = AllocateCopyPool(StrSize(Node->FileName), Node->FileName);\r
+ NewNode->Info = AllocateCopyPool((UINTN)Node->Info->Size, Node->Info);\r
if ( NewNode->FullName == NULL\r
|| NewNode->FileName == NULL\r
|| NewNode->Info == NULL\r
if (!Save) {\r
Node->Handle = NULL;\r
}\r
- StrCpy((CHAR16*)NewNode->FullName, Node->FullName);\r
- StrCpy((CHAR16*)NewNode->FileName, Node->FileName);\r
- CopyMem(NewNode->Info, Node->Info, (UINTN)Node->Info->Size);\r
\r
return((EFI_SHELL_FILE_INFO*)NewNode);\r
}\r
}\r
SHELL_FREE_NON_NULL(BasePath);\r
return(Status);\r
-}\r
+ }\r
\r
/**\r
Get the GUID value from a human readable name.\r
if (NewFullName == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
} else {\r
- StrCpy(NewFullName, MapName);\r
- StrCat(NewFullName, ShellInfoNode->FullName+1);\r
+ StrnCpy(NewFullName, MapName, Size/sizeof(CHAR16)-1);\r
+ StrnCat(NewFullName, ShellInfoNode->FullName+1, (Size/sizeof(CHAR16))-StrLen(NewFullName)-1);\r
FreePool((VOID*)ShellInfoNode->FullName);\r
ShellInfoNode->FullName = NewFullName;\r
}\r
RootDevicePath = NULL;\r
RootFileHandle = NULL;\r
MapName = NULL;\r
- PatternCopy = AllocateZeroPool(StrSize(FilePattern));\r
+ PatternCopy = AllocateCopyPool(StrSize(FilePattern), FilePattern);\r
if (PatternCopy == NULL) {\r
return (EFI_OUT_OF_RESOURCES);\r
}\r
- StrCpy(PatternCopy, FilePattern);\r
\r
PatternCopy = PathCleanUpDirectories(PatternCopy);\r
\r
; Node = (ENV_VAR_LIST*)GetNextNode(&List, &Node->Link)\r
){\r
ASSERT(Node->Key != NULL);\r
- StrCpy(CurrentWriteLocation, Node->Key);\r
+ StrnCpy(CurrentWriteLocation, Node->Key, (Size)/sizeof(CHAR16) - (CurrentWriteLocation - ((CHAR16*)Buffer)) - 1);\r
CurrentWriteLocation += StrLen(CurrentWriteLocation) + 1;\r
}\r
\r
// Allocate the space and recall the get function\r
//\r
Buffer = AllocateZeroPool(Size);\r
- ASSERT(Buffer != NULL);\r
Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(Name, Attributes, &Size, Buffer);\r
}\r
//\r