/** @file\r
The implementation of construct ENTRY_INDEXER in IpSecConfig application.\r
\r
- Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2016, 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
} else if (ShellCommandLineGetFlag (ParamPackage, L"-e")) {\r
ValueStr = ShellCommandLineGetValue (ParamPackage, L"-e");\r
} else {\r
- ASSERT (FALSE);\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
- ASSERT (ValueStr != NULL);\r
-\r
+ if (ValueStr == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ \r
Value64 = StrToUInteger (ValueStr, &Status);\r
if (!EFI_ERROR (Status)) {\r
Indexer->Index = (UINTN) Value64;\r
- Indexer->Name = NULL;\r
+ ZeroMem (Indexer->Name, MAX_PEERID_LEN);\r
} else {\r
- UnicodeStrToAsciiStr (ValueStr, (CHAR8 *) Indexer->Name);\r
+ UnicodeStrToAsciiStrS (ValueStr, (CHAR8 *) Indexer->Name, MAX_PEERID_LEN);\r
}\r
\r
return EFI_SUCCESS;\r
} else if (ShellCommandLineGetFlag (ParamPackage, L"-e")) {\r
ValueStr = ShellCommandLineGetValue (ParamPackage, L"-e");\r
} else {\r
- ASSERT (FALSE);\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
- ASSERT (ValueStr != NULL);\r
+ if (ValueStr == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
Value64 = StrToUInteger (ValueStr, &Status);\r
if (!EFI_ERROR (Status)) {\r
} else if (ShellCommandLineGetFlag (ParamPackage, L"-e")) {\r
ValueStr = ShellCommandLineGetValue (ParamPackage, L"-e");\r
} else {\r
- ASSERT (FALSE);\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
- ASSERT (ValueStr != NULL);\r
+ if (ValueStr == NULL) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
Value64 = StrToUInteger (ValueStr, &Status);\r
\r
The internal structure and function declaration to construct ENTRY_INDEXER in\r
IpSecConfig application.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2016, 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
#define _INDEXER_H_\r
\r
typedef struct {\r
- UINT8 *Name;\r
- UINTN Index; // Used only if Name is NULL.\r
+ UINT8 Name[MAX_PEERID_LEN];\r
+ UINTN Index; // Used only if Name buffer is filled with zero.\r
} SPD_ENTRY_INDEXER;\r
\r
typedef struct {\r
/** @file\r
The implementation of match policy entry function in IpSecConfig application.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2016, 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
BOOLEAN Match;\r
\r
Match = FALSE;\r
- if (Indexer->Name != NULL) {\r
+ if (!IsMemoryZero (Indexer->Name, MAX_PEERID_LEN)) {\r
if ((Data->Name != NULL) && (AsciiStrCmp ((CHAR8 *) Indexer->Name, (CHAR8 *) Data->Name) == 0)) {\r
Match = TRUE;\r
}\r