]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.
authorCinnamon Shia <cinnamon.shia@hpe.com>
Mon, 22 Feb 2016 02:53:14 +0000 (10:53 +0800)
committerLaszlo Ersek <lersek@redhat.com>
Mon, 29 Feb 2016 13:19:27 +0000 (14:19 +0100)
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>
MdeModulePkg/Universal/HiiDatabaseDxe/String.c

index 2d04be4b622714d25bf87abec934f54ddb58c32e..756f19c7c3fc2d46cee17329691c4a7d729cd338 100644 (file)
@@ -3,6 +3,7 @@ Implementation for EFI_HII_STRING_PROTOCOL.
 \r
 \r
 Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -295,6 +296,7 @@ FindStringBlock (
   ASSERT (StringPackage->Signature == HII_STRING_PACKAGE_SIGNATURE);\r
 \r
   CurrentStringId = 1;\r
+  StringSize = 0;\r
 \r
   if (StringId != (EFI_STRING_ID) (-1) && StringId != 0) {\r
     ASSERT (BlockType != NULL && StringBlockAddr != NULL && StringTextOffset != NULL);\r