diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-07 10:17:16 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-07 10:17:16 +0000 |
commit | b7b0dca207fd89af69dac1eda05e5cd2adbe8cc1 (patch) | |
tree | b24c7048a34079eb0267562b4355067a42f2d5fc /IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c | |
parent | ee09c93f45f0bf6f3d8fcc51bc99d87baf248525 (diff) | |
download | edk2-platforms-b7b0dca207fd89af69dac1eda05e5cd2adbe8cc1.tar.xz |
Fix some issues reported by source static analysis tools.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8785 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c index 643c90d4b1..2334fd61b6 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c @@ -490,6 +490,7 @@ UpdateConsolePage ( NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index2);
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
+ ASSERT (Index < MAX_MENU_NUMBER);
if (((NewTerminalContext->IsConIn != 0) && (UpdatePageId == FORM_CON_IN_ID)) ||
((NewTerminalContext->IsConOut != 0) && (UpdatePageId == FORM_CON_OUT_ID)) ||
((NewTerminalContext->IsStdErr != 0) && (UpdatePageId == FORM_CON_ERR_ID))
@@ -755,6 +756,7 @@ UpdateConModePage ( UINTN Row;
CHAR16 RowString[50];
CHAR16 ModeString[50];
+ CHAR16 *pStr;
UINTN TempStringLen;
UINTN MaxMode;
UINTN ValidMode;
@@ -811,11 +813,11 @@ UpdateConModePage ( // Build mode string Column x Row
//
TempStringLen = UnicodeValueToString (ModeString, 0, Col, 0);
- ASSERT ((TempStringLen + StrLen (L" x ")) < (sizeof (ModeString) / sizeof (ModeString[0])));
- StrCat (ModeString, L" x ");
+ pStr = &ModeString[0];
+ StrnCat (pStr, L" x ", StrLen(L" x "));
TempStringLen = UnicodeValueToString (RowString, 0, Row, 0);
- ASSERT ((StrLen (ModeString) + TempStringLen) < (sizeof (ModeString) / sizeof (ModeString[0])));
- StrCat (ModeString, RowString);
+ pStr = &ModeString[0];
+ StrnCat (pStr, RowString, StrLen(RowString));
ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);
|