]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Do not assert in HiiBlockToConfig function when an invalid format of ConfigRequest...
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 13 Apr 2011 03:13:13 +0000 (03:13 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 13 Apr 2011 03:13:13 +0000 (03:13 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11526 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c

index e51de1371ad520762870b7b559f66c9baa2fffad..30f602d30fe316aa2877106fa42a1990eba02a8c 100644 (file)
@@ -453,8 +453,9 @@ GetValueOfNumber (
   UINTN                    Index;\r
   CHAR16                   TemStr[2];\r
 \r
-  ASSERT (StringPtr != NULL && Number != NULL && Len != NULL);\r
-  ASSERT (*StringPtr != L'\0');\r
+  if (StringPtr == NULL || *StringPtr == L'\0' || Number == NULL || Len == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
 \r
   Buf = NULL;\r
 \r
@@ -3103,7 +3104,7 @@ HiiBlockToConfig (
     // Get Offset\r
     //\r
     Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length);\r
-    if (Status == EFI_OUT_OF_RESOURCES) {\r
+    if (EFI_ERROR (Status)) {\r
       *Progress = ConfigRequest;\r
       goto Exit;\r
     }\r
@@ -3127,7 +3128,7 @@ HiiBlockToConfig (
     // Get Width\r
     //\r
     Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length);\r
-    if (Status == EFI_OUT_OF_RESOURCES) {\r
+    if (EFI_ERROR (Status)) {\r
       *Progress = ConfigRequest;\r
       goto Exit;\r
     }\r
@@ -3394,7 +3395,7 @@ HiiConfigToBlock (
     // Get Width\r
     //\r
     Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length);\r
-    if (Status == EFI_OUT_OF_RESOURCES) {\r
+    if (EFI_ERROR (Status)) {\r
       *Progress = ConfigResp;\r
       goto Exit;\r
     }\r