Reviewed-by: Eric Dong <eric.d...@intel.com>
Feng & Star, Can you help to check in this patch? Thanks, Eric -----Original Message----- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Cinnamon Shia Sent: Monday, February 22, 2016 10:53 AM To: edk2-devel@lists.01.org Subject: [edk2] [PATCH] 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.s...@hpe.com> --- MdeModulePkg/Universal/HiiDatabaseDxe/String.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c index 2d04be4..756f19c 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); -- 2.7.0.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel