summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-27 09:04:11 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-27 09:04:11 +0000
commit771ececd1288bb2bee8ea6fee61a1a0220914be5 (patch)
tree8322a497f5fed08816a28ee95c4d143bb49aa23b /MdeModulePkg
parent3978f5d92b31c42c2e6090409d1d83eefdb5face (diff)
downloadedk2-platforms-771ececd1288bb2bee8ea6fee61a1a0220914be5.tar.xz
Add the missing check for NULL pointer before use it.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10116 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c4
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Expression.c3
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c2
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c7
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.h2
5 files changed, 15 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index 2934ab383a..0339565350 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -3192,7 +3192,7 @@ Exit:
@param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
instance.
@param ConfigResp A null-terminated Unicode string in <ConfigResp>
- format. It can be ConfigAltResp format string.
+ format.
@param Block A possibly null array of bytes representing the
current block. Only bytes referenced in the
ConfigResp string in the block are modified. If
@@ -3415,7 +3415,7 @@ Exit:
@param This A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL
instance.
@param Configuration A null-terminated Unicode string in
- <MultiConfigAltResp> format. It is <ConfigAltResp> format.
+ <MultiConfigAltResp> format.
@param Guid A pointer to the GUID value to search for in the
routing portion of the ConfigResp string when
retrieving the requested data. If Guid is NULL,
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
index 90fdc7462f..45ec96edf1 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
@@ -1729,6 +1729,7 @@ EvaluateExpression (
//
Status = GetValueByName (OpCode->VarStorage, OpCode->ValueName, &StrPtr);
if (!EFI_ERROR (Status)) {
+ ASSERT (StrPtr != NULL);
TempLength = StrLen (StrPtr);
if (OpCode->ValueWidth >= ((TempLength + 1) / 2)) {
Value->Type = OpCode->ValueType;
@@ -1740,7 +1741,7 @@ EvaluateExpression (
if ((Index & 1) == 0) {
TempBuffer [Index/2] = DigitUint8;
} else {
- TempBuffer [Index/2] = (UINT8) ((DigitUint8 << 4) + TempStr [Index/2]);
+ TempBuffer [Index/2] = (UINT8) ((DigitUint8 << 4) + TempBuffer [Index/2]);
}
}
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 5593b6eeb5..7660c6ef1f 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -1174,6 +1174,7 @@ ParseOpCodes (
//
if (CurrentExpression == NULL && MapScopeDepth > 0) {
CurrentExpression = CreateExpression (CurrentForm);
+ ASSERT (MapExpressionList != NULL);
InsertTailList (MapExpressionList, &CurrentExpression->Link);
if (Scope == 0) {
SingleOpCodeExpression = TRUE;
@@ -2120,6 +2121,7 @@ ParseOpCodes (
//
Status = PopCurrentExpression ((VOID **) &CurrentExpression);
ASSERT_EFI_ERROR (Status);
+ ASSERT (MapScopeDepth > 0);
MapScopeDepth --;
break;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 6d5a3db2e5..3704596f30 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -109,6 +109,8 @@ NewStrCat (
hit, then 2 Unicode character will consume an output storage
space with size of CHAR16 till a NARROW_CHAR is hit.
+ If String is NULL, then ASSERT ().
+
@param String The input string to be counted.
@return Storage space for the input string.
@@ -123,6 +125,11 @@ GetStringWidth (
UINTN Count;
UINTN IncrementValue;
+ ASSERT (String != NULL);
+ if (String == NULL) {
+ return 0;
+ }
+
Index = 0;
Count = 0;
IncrementValue = 1;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.h b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
index 45fb3eba3e..6b65103714 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
@@ -623,6 +623,8 @@ ClearLines (
hit, then 2 Unicode character will consume an output storage
space with size of CHAR16 till a NARROW_CHAR is hit.
+ If String is NULL, then ASSERT ().
+
@param String The input string to be counted.
@return Storage space for the input string.