From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) Received: from mga05.intel.com (mga05.intel.com []) by groups.io with SMTP; Mon, 15 Jul 2019 00:31:02 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 00:31:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,493,1557212400"; d="scan'208";a="187064431" Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 15 Jul 2019 00:31:01 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jaben Carsey , Ray Ni , Oleksiy Subject: [PATCH] ShellPkg/UefiShellDriver1CommandsLib: Make array big enough Date: Mon, 15 Jul 2019 15:30:07 +0800 Message-Id: <20190715073007.25732-4-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190715073007.25732-1-zhichao.gao@intel.com> References: <20190715073007.25732-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1941 The two CHAR16 array ChildCountStr and DeviceCountStr is defined to hold the decimal string data of UINTN. The max of UINTN is 18446744073709551615 and it contain 20 characters. So make their size to 21 CHAR16s to hold the string data with a null-terminate. UnicodeValueToStringS regard the value input as INT64, and 21 CHARs is enough to hold the lowest value with minus '-'. Although the value shouldn't be such big. Cc: Jaben Carsey Cc: Ray Ni Cc: Oleksiy Signed-off-by: Zhichao Gao --- ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c index 794b737bd1..40deb68808 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c @@ -263,8 +263,8 @@ ShellCommandRunDrivers ( EFI_HANDLE *HandleWalker; UINTN ChildCount; UINTN DeviceCount; - CHAR16 ChildCountStr[3]; - CHAR16 DeviceCountStr[3]; + CHAR16 ChildCountStr[21]; + CHAR16 DeviceCountStr[21]; CHAR16 *Temp2; CONST CHAR16 *FullDriverName; CHAR16 *TruncatedDriverName; -- 2.21.0.windows.1