From nobody Sun May 5 12:38:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43713+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43713+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563175865; cv=none; d=zoho.com; s=zohoarc; b=OQrjULIn43R+YixrMbgAgGUngdbc9XbEa6ZxrPbuijah9z6Cuyx47nzJctQTI5D/ZNlmHZ+D7+AKSyUjphkjQ9ZU4ckIIFPvMFp/kEk6NC5VGxLq5WJ2kqbw8S0EBIEGDo+kihiHIFlv0N1qsViofxQ6EhNL1uwNlxL2pwDogUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563175865; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=zUs46hi++EKg+02UflfoQc2m1UxX9F8pJoobK4RSGq0=; b=VYY2CVeIwaAGFLILoECNOBRDwK2CaBmhRTYWfdER7fjdZkRav3h1pwPTlcPJm5FX3dzvyo1k1oyghw0o/lNehPc9t3fLF+UkgFxJzvv460EyiPgBISOJOC6U+FlNifDfud/FiNEcB66/NywuPJomzvNMsBqA9g4JT5s1fKD261A= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43713+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156317586549272.0208953610462; Mon, 15 Jul 2019 00:31:05 -0700 (PDT) Return-Path: X-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 X-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" X-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: [edk2-devel] [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> In-Reply-To: <20190715073007.25732-1-zhichao.gao@intel.com> References: <20190715073007.25732-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563175863; bh=SDx1rrWj3554bwnbC3fyftrUQXFHg1p3KHxQdKciod8=; h=Cc:Date:From:Reply-To:Subject:To; b=SPK1ZE0WaPhtZMku36BjSzyO3fMgu2WoX8XPLuUpyALhO19P+XKdwnQVEHhvzVO3lPZ 8+q/85ZmJniT7yJNTYtldHYCdobpb7OOjOfWGlxAlFs3VFXitInZgmB/CoAcz3ADNoAng G8KY4Bv3697WD/DLGQmKbAY0s13Uo6thaEE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1941 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/Shell= Pkg/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; --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43713): https://edk2.groups.io/g/devel/message/43713 Mute This Topic: https://groups.io/mt/32476117/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-