summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCinnamon Shia <cinnamon.shia@hpe.com>2016-02-22 10:53:14 +0800
committerHao Wu <hao.a.wu@intel.com>2017-05-16 10:35:14 +0800
commit6404e16dbbf89fffc246bdc627de8be8e3a3003e (patch)
tree9651fb7a70e2175f8d24e2af788ebf53c43355c9
parent86bf81994d5658fbf94a83eb34327e6f2dd4b7f9 (diff)
downloadedk2-6404e16dbbf89fffc246bdc627de8be8e3a3003e.tar.gz
edk2-6404e16dbbf89fffc246bdc627de8be8e3a3003e.tar.bz2
edk2-6404e16dbbf89fffc246bdc627de8be8e3a3003e.zip
MdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.
The StringSize variable in the FindStringBlock function is a IN OUT parameter of the GetUnicodeStringTextOrSize function. Thought the GetUnicodeStringTextOrSize function changes the value of the StringSize variable, it is better to initialize the StringSize variable before passing it to the GetUnicodeStringTextOrSize function. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit f5e6aa8e176c3f1dc557d85749ef797b8d482b56)
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/String.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
index 2d04be4b62..756f19c7c3 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
@@ -3,6 +3,7 @@ Implementation for EFI_HII_STRING_PROTOCOL.
Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -295,6 +296,7 @@ FindStringBlock (
ASSERT (StringPackage->Signature == HII_STRING_PACKAGE_SIGNATURE);
CurrentStringId = 1;
+ StringSize = 0;
if (StringId != (EFI_STRING_ID) (-1) && StringId != 0) {
ASSERT (BlockType != NULL && StringBlockAddr != NULL && StringTextOffset != NULL);