summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c7
1 files changed, 7 insertions, 0 deletions
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;