]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Refine code to make it more safely.
authorEric Dong <eric.dong@intel.com>
Wed, 25 Jun 2014 06:51:36 +0000 (06:51 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 25 Jun 2014 06:51:36 +0000 (06:51 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15592 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/IsaFloppyPei/FloppyPeim.c
IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
IntelFrameworkModulePkg/Universal/FirmwareVolume/UpdateDriverDxe/UpdateDispatcher.c

index d1b7dcf416a1909c336b6a4bc0e5b3965dc55ac3..765a46dd31d17174a5fc0666bc28a2c7e662aebe 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Floppy Peim to support Recovery function from Floppy device.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, 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\r
@@ -1610,6 +1610,7 @@ FdcReadBlocks (
   VOID                  *MemPage;\r
 \r
   FdcBlkIoDev = NULL;\r
+  ZeroMem (&MediaInfo, sizeof (EFI_PEI_BLOCK_IO_MEDIA));\r
 \r
   if (This == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
index bcc9764100ba1857d9b17e9b8251a9dbe95f6150..e35c685ed8d2700c0a4635cc45f79d2b4a17e1a3 100644 (file)
@@ -2,7 +2,7 @@
   UEFI and Tiano Custom Decompress Library \r
   It will do Tiano or UEFI decompress with different verison parameter.\r
   \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -323,6 +323,7 @@ ReadPTLen (
   UINT16  Index;\r
   UINT32  Mask;\r
 \r
+  ASSERT (nn < NPT);\r
   //\r
   // Read Extra Set Code Length Array size \r
   //\r
index f816d4c39eda8b055c6fb553d7b3a2b92b0d86b5..c58c6fd87ff47a2943a161cb138155071dae04f7 100644 (file)
@@ -864,6 +864,7 @@ BdsAddNonExistingLegacyBootOptions (
                 &BootOrderSize\r
                 );\r
       if (!EFI_ERROR (Status)) {\r
+        ASSERT (BootOrder != NULL);\r
         BbsIndex     = Index;\r
         OptionNumber = BootOrder[BootOrderSize / sizeof (UINT16) - 1];\r
       }\r
@@ -4352,6 +4353,7 @@ BdsLibUpdateFvFileDevicePath (
     NewDevicePath = DevicePathFromHandle (FoundFvHandle);\r
     EfiInitializeFwVolDevicepathNode (&FvFileNode, FileGuid);\r
     NewDevicePath = AppendDevicePathNode (NewDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &FvFileNode);\r
+    ASSERT (NewDevicePath != NULL);\r
     *DevicePath = NewDevicePath;\r
     return EFI_SUCCESS;\r
   }\r
index 591f884a944b329f4b2059ed81dac3c839e3457c..e1a53135b5d6e144dea3fad9d0800bc4003bfd6e 100644 (file)
@@ -1740,17 +1740,14 @@ GetLegacyDeviceOrder (
       LegacyOrder = CallbackData->BmmFakeNvData.LegacyNET;\r
       OldData     = CallbackData->BmmOldFakeNVData.LegacyNET;\r
       break;\r
-    \r
-    case FORM_SET_BEV_ORDER_ID:\r
+\r
+    default:\r
+      ASSERT (PageIdList[Index] == FORM_SET_BEV_ORDER_ID);\r
       OptionMenu  = (BM_MENU_OPTION *) &LegacyBEVMenu;\r
       BbsType     = BBS_BEV_DEVICE;\r
       LegacyOrder = CallbackData->BmmFakeNvData.LegacyBEV;\r
       OldData     = CallbackData->BmmOldFakeNVData.LegacyBEV;\r
       break;\r
-      \r
-    default:\r
-      DEBUG ((DEBUG_ERROR, "Invalid command ID for updating page!\n"));\r
-      break;\r
     }\r
     \r
     if (NULL != VarData) {\r
index 99b8d3c3588886e6042dfc2a457be5f8e8fd3f65..e1f1b023dcc0c89eb65bad9f9b50ad709f0abc21 100644 (file)
@@ -3,7 +3,7 @@
   for the image to be programmed, and the flash area that is going to be\r
   programed.\r
 \r
-  Copyright (c) 2002 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2002 - 2014, 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\r
@@ -755,6 +755,7 @@ InitializeUpdateDriver (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+  ASSERT (ConfigData != NULL);\r
 \r
   //\r
   // Now find the update image. The update image should be put in a FV, and then\r