]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add some security check.
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 5 Feb 2010 06:13:18 +0000 (06:13 +0000)
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 5 Feb 2010 06:13:18 +0000 (06:13 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9934 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c
MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c

index 2fd355029d33f6c9067e651a8da9d8f5c5e41c50..0ed8169bed088ab642aa0a6d398c7ab6758e4b06 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for EFI_HII_FONT_PROTOCOL.\r
 \r
 \r
-Copyright (c) 2007 - 2009, Intel Corporation\r
+Copyright (c) 2007 - 2010, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -2392,6 +2392,7 @@ HiiGetGlyph (
     if (EFI_ERROR (Status)) {\r
       goto Exit;\r
     }\r
+    ASSERT (StringInfoOut != NULL);\r
     FontInfo   = &StringInfoOut->FontInfo;\r
     Foreground = StringInfoOut->ForegroundColor;\r
     Background = StringInfoOut->BackgroundColor;\r
@@ -2622,7 +2623,7 @@ HiiGetFontInfo (
     InfoOut.BackgroundColor = SystemDefault->BackgroundColor;\r
   }\r
   \r
-\r
+  ASSERT (FontInfo != NULL);\r
   FontInfo->FontSize  = InfoOut.FontInfo.FontSize;\r
   FontInfo->FontStyle = InfoOut.FontInfo.FontStyle;\r
 \r
index 54d317416d6468447653ed5fefdce470c83f73af..b11e7c96d56377b7a921586b3232af8d0b261563 100644 (file)
@@ -480,8 +480,7 @@ InstallVlanConfigForm (
   PrivateData->MacString = MacString;\r
 \r
   StrCpy (Str, L"VLAN Configuration (MAC:");\r
-  ASSERT (StrLen (MacString) <= (sizeof (EFI_MAC_ADDRESS) * 2));\r
-  StrCat (Str, MacString);\r
+  StrnCat (Str, MacString, sizeof (EFI_MAC_ADDRESS) * 2);\r
   StrCat (Str, L")");\r
   HiiSetString (\r
     HiiHandle,\r
index 8a53c63a507f3f732221cb39c4782ea374809496..02684e46ca799614817287e4aa26f1987e8219ae 100644 (file)
@@ -1505,6 +1505,7 @@ ParseOpCodes (
       //\r
       // Now we know the Storage width of nested Ordered List\r
       //\r
+      ASSERT (CurrentStatement != NULL);\r
       if ((CurrentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (CurrentStatement->BufferValue == NULL)) {\r
         Width = 1;\r
         switch (CurrentOption->Value.Type) {\r
index ab98ada1c800838aab73f023e208677e5502d28b..81de737a03a9301671f49c19b6f0edb51c6253af 100644 (file)
@@ -1138,11 +1138,13 @@ GetQuestionValue (
       //\r
       CopyMem (Dst, Storage->EditBuffer + Question->VarStoreInfo.VarOffset, StorageWidth);\r
     } else {\r
+      Value = NULL;\r
       Status = GetValueByName (Storage, Question->VariableName, &Value);\r
       if (EFI_ERROR (Status)) {\r
         return Status;\r
       }\r
 \r
+      ASSERT (Value != NULL);\r
       LengthStr = StrLen (Value);\r
       Status    = EFI_SUCCESS;\r
       if (IsString) {\r