From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False 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 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,429,1508828400"; d="scan'208";a="13197401" 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 From: "Kinney, Michael D" To: edk2-devel@lists.01.org Cc: Sean Brogan , Liming Gao , Michael D Kinney 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: [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: , X-List-Received-Date: Tue, 19 Dec 2017 23:55:36 -0000 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/UnitTestBootUsb.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 = 0, VariableSize = 0; BOOLEAN IsUsbOptionFound = FALSE; - StrCpy(BootOptionName, L"Boot000"); + StrCpyS(BootOptionName, sizeof (BootOptionName) / sizeof (BootOptionName[0]), L"Boot000"); BootOptionIndexChar = BootOptionName + StrLen(BootOptionName); // @@ -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) / sizeof (BootOptionName[0]) - StrLen(BootOptionName), 0, (INT64)BootOptionIndex, 1); // Attempt to retrieve the option. DEBUG(( DEBUG_VERBOSE, __FUNCTION__" - Checking for %s...\n", BootOptionName )); -- 2.14.2.windows.3