/** @file\r
The implementation for Shell application IfConfig6.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
EFI_HII_HANDLE mHiiHandle;\r
\r
-EFI_GUID mEfiIfConfig6Guid = EFI_IFCONFIG6_GUID;\r
SHELL_PARAM_ITEM mIfConfig6CheckList[] = {\r
{\r
L"-b",\r
ARG_LIST *ArgList;\r
ARG_LIST *ArgNode;\r
\r
- if (*String == L'\0') {\r
+ if (*String == L'\0' || *String == NULL) {\r
return NULL;\r
}\r
\r
//\r
// Copy the CONST string to a local copy.\r
//\r
- Str = (CHAR16 *) AllocateZeroPool (StrSize (String));\r
+ Str = AllocateCopyPool (StrSize (String), String);\r
ASSERT (Str != NULL);\r
- Str = StrCpy (Str, String);\r
ArgStr = Str;\r
\r
//\r
/**\r
The notify function of create event when performing a manual config.\r
\r
- @param[in] CheckList The pointer of Event.\r
- @param[in] Context The pointer of Context.\r
+ @param[in] Event The event this notify function registered to.\r
+ @param[in] Context Pointer to the context data registered to the event.\r
\r
**/\r
VOID\r
\r
@param[in, out] Arg The pointer of the address of ARG_LIST which save Args with the "-s" option.\r
@param[out] Buf The pointer of the address of EFI_IP6_CONFIG_MANUAL_ADDRESS.\r
- @param[out] Address The pointer of BufSize that describes the size of Buf in bytes.\r
+ @param[out] BufSize The pointer of BufSize that describes the size of Buf in bytes.\r
\r
@retval EFI_SUCCESS The convertion is successful.\r
@retval Others Does't find the host address, or it is an invalid IPv6 address in string format.\r
UINT8 Prefix;\r
UINT8 AddrCnt;\r
\r
+ Prefix = 0;\r
AddrCnt = 0;\r
*BufSize = 0;\r
*Buf = NULL;\r
\r
@param[in, out] Arg The pointer of the address of ARG_LIST that save Args with the "-s" option.\r
@param[out] Buf The pointer of the address of EFI_IPv6_ADDRESS.\r
- @param[out] Address The pointer of BufSize that describes the size of Buf in bytes.\r
+ @param[out] BufSize The pointer of BufSize that describes the size of Buf in bytes.\r
\r
@retval EFI_SUCCESS The conversion is successful.\r
@retval Others Doesn't find the host address, or it is an invalid IPv6 address in string format.\r
Private->OpCode = IfConfig6OpList;\r
ValueStr = ShellCommandLineGetValue (ParamPackage, L"-l");\r
if (ValueStr != NULL) {\r
- Str = (CHAR16 *) AllocateZeroPool (StrSize (ValueStr));\r
+ Str = AllocateCopyPool (StrSize (ValueStr), ValueStr);\r
ASSERT (Str != NULL);\r
-\r
- Str = StrCpy (Str, ValueStr);\r
Private->IfName = Str;\r
}\r
}\r
Private->OpCode = IfConfig6OpClear;\r
ValueStr = ShellCommandLineGetValue (ParamPackage, L"-r");\r
if (ValueStr != NULL) {\r
- Str = (CHAR16 *) AllocateZeroPool (StrSize (ValueStr));\r
+ Str = AllocateCopyPool (StrSize (ValueStr), ValueStr);\r
ASSERT (Str != NULL);\r
-\r
- Str = StrCpy (Str, ValueStr);\r
Private->IfName = Str;\r
}\r
}\r