From nobody Sun May 19 20:02:56 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+44097+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+44097+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1563778700; cv=none; d=zoho.com; s=zohoarc; b=nJDYzXcvHPPXBiMz+2HdCdx40wk+2pOoUlLGjpm9B9pzFXW1V0xcXN+P/+xmJMM3dwnS35tPc8zsMfum20ckk21+KfrFLH3vBRjpZhMXfVXlDUYzbTQUFrCqcM1Ri0mqSsEotqz0Lp7KU+mhLbwiTqewCXyNJPhcbAlaI61c54A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563778700; 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=rpaxsieZINI4Ntc+x/QRWGqneJLmMHu5kOMVPnmnXus=; b=QtKMHY+WEh7Kve94jlk8HvPAZsGCXWAmiS6j/CrOejt3dA+dCyGFfsCgrZvHdgtTzEdYawTM67XvWB3mwBS5ZZXVI9aZ5axfsqrXWU7GTt9VNlQv5I2MbI1lnPYPVsbDBGeH27wfeCR7bur+Qk/AYJ4deY5QBq6pI5HFoVJe/zc= 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+44097+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 1563778699992689.385418298132; Sun, 21 Jul 2019 23:58:19 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Sun, 21 Jul 2019 23:58:19 -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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 23:58:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,294,1559545200"; d="scan'208";a="188545643" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 21 Jul 2019 23:58:18 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jaben Carsey , Ray Ni , Oleksiy Subject: [edk2-devel] [PATCH V2] ShellPkg/UefiShellDriver1CommandsLib: Make array big enough Date: Mon, 22 Jul 2019 14:57:56 +0800 Message-Id: <20190722065756.18856-3-zhichao.gao@intel.com> In-Reply-To: <20190722065756.18856-1-zhichao.gao@intel.com> References: <20190722065756.18856-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=1563778699; bh=MSRqC7UgpIO/n2aJuNY6TSJFDc28hynt9IM81qjvi2I=; h=Cc:Date:From:Reply-To:Subject:To; b=pHQUxutJ4lugyDhH6fS0NXMJmh1CwYfqriQ3NVwz8Imo6M2GVmklA2hGYN+V4X1AiB4 RBhNOUUkMCDPYtd9QJH3kwWucgemkelhlCP1/sXECbqXdKx5tcITB+qOV5NvWRpe2JL8M m/JeY3cfWglXsxMqR0Ud/zUbl1+Wc+R1rx8= 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 --- V2: Update the copyright. ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/Shell= Pkg/Library/UefiShellDriver1CommandsLib/Drivers.c index 794b737bd1..27cd278cf0 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c @@ -2,7 +2,7 @@ Main file for Drivers shell Driver1 function. =20 (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -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 (#44097): https://edk2.groups.io/g/devel/message/44097 Mute This Topic: https://groups.io/mt/32556057/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-