From nobody Tue Jan 14 22:58:19 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1513728046887521.2222622191545; Tue, 19 Dec 2017 16:00:46 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B81A4221EA0AB; Tue, 19 Dec 2017 15:55:42 -0800 (PST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5E1F0221523B9 for ; Tue, 19 Dec 2017 15:55:36 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2017 16:00:23 -0800 Received: from mdkinney-mobl2.amr.corp.intel.com ([10.241.98.58]) by FMSMGA003.fm.intel.com with ESMTP; 19 Dec 2017 16:00:23 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,429,1508828400"; d="scan'208";a="13197401" From: "Kinney, Michael D" To: edk2-devel@lists.01.org Date: Tue, 19 Dec 2017 16:00:09 -0800 Message-Id: <20171220000014.9140-6-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 In-Reply-To: <20171220000014.9140-1-michael.d.kinney@intel.com> References: <20171220000014.9140-1-michael.d.kinney@intel.com> Subject: [edk2] [staging/edk2-test Patch 05/10] MsUnitTestPkg/Library: Use safe string functions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Update UnitTestLib and UnitTestBootUsbMicrosoftLib to use safe string functions from the BaseLib and PrintLib. Cc: Sean Brogan Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney --- MsUnitTestPkg/Library/UnitTestBootUsbMicrosoftLib/UnitTestBootUsb.c | 4 ++= -- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MsUnitTestPkg/Library/UnitTestBootUsbMicrosoftLib/UnitTestBoot= Usb.c b/MsUnitTestPkg/Library/UnitTestBootUsbMicrosoftLib/UnitTestBootUsb.c index 85f5ee5a0e..677d3edb0a 100644 --- a/MsUnitTestPkg/Library/UnitTestBootUsbMicrosoftLib/UnitTestBootUsb.c +++ b/MsUnitTestPkg/Library/UnitTestBootUsbMicrosoftLib/UnitTestBootUsb.c @@ -46,7 +46,7 @@ SetUsbBootNext ( UINTN OptionBufferSize =3D 0, VariableSize =3D 0; BOOLEAN IsUsbOptionFound =3D FALSE; =20 - StrCpy(BootOptionName, L"Boot000"); + StrCpyS(BootOptionName, sizeof (BootOptionName) / sizeof (BootOptionName= [0]), L"Boot000"); BootOptionIndexChar =3D BootOptionName + StrLen(BootOptionName); =20 // @@ -56,7 +56,7 @@ SetUsbBootNext ( { // Construct the BootOption name for this boot option. // Do this by altering the last character of the name. - UnicodeValueToString(BootOptionIndexChar, 0, (INT64)BootOptionIndex, 1= ); + UnicodeValueToStringS(BootOptionIndexChar, sizeof (BootOptionName) / s= izeof (BootOptionName[0]) - StrLen(BootOptionName), 0, (INT64)BootOptionInd= ex, 1); =20 // Attempt to retrieve the option. DEBUG(( DEBUG_VERBOSE, __FUNCTION__" - Checking for %s...\n", BootOpti= onName )); --=20 2.14.2.windows.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel