summaryrefslogtreecommitdiff
path: root/MdePkg/Library/UefiLib/Console.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/UefiLib/Console.c')
-rw-r--r--MdePkg/Library/UefiLib/Console.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/MdePkg/Library/UefiLib/Console.c b/MdePkg/Library/UefiLib/Console.c
index d06b0a932d..4fbdef7350 100644
--- a/MdePkg/Library/UefiLib/Console.c
+++ b/MdePkg/Library/UefiLib/Console.c
@@ -263,6 +263,10 @@ UnicodeStringDisplayLength (
UINTN Length;
UINTN Width;
+ if (String == NULL) {
+ return 0;
+ }
+
Length = 0;
while (*String != 0) {
Width = GetGlyphWidth (*String);