]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
Refine code to make it more safely.
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / IfrParse.c
index e806b504b2934fdc4079d02b928dd862f48db7ca..22f257dd4eceeda32a9dabf0f837e89ebf3337c6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Parser for IFR binary encoding.\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -663,6 +663,7 @@ InitializeRequestElement (
     ASSERT (ConfigInfo != NULL);\r
     ConfigInfo->Signature     = FORM_BROWSER_CONFIG_REQUEST_SIGNATURE;\r
     ConfigInfo->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigHdr), Storage->ConfigHdr);\r
+    ASSERT (ConfigInfo->ConfigRequest != NULL);\r
     ConfigInfo->SpareStrLen   = 0;\r
     ConfigInfo->Storage       = Storage;\r
     InsertTailList(&Form->ConfigRequestHead, &ConfigInfo->Link);\r
@@ -2327,6 +2328,7 @@ ParseOpCodes (
         break;\r
 \r
       case EFI_IFR_ONE_OF_OPTION_OP:\r
+        ASSERT (CurrentOption != NULL);\r
         ImageId = &CurrentOption->ImageId;\r
         break;\r
 \r