From nobody Mon May 20 16:07:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54659+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54659+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1582163073; cv=none; d=zohomail.com; s=zohoarc; b=m5Qd3FTNPndV7hymdrFvwTRIrVNt/MdC3171PEAh6uAlq8aKZFih8qgSTgM0NT7UTkmDJ1vhoR1+oO341aWpoVsyCkLlQYCkXUzmxbvfHAzVdxJgOx9DIBGaSjo+VbV+JZUqug8bW+E7WNSUCZJJVY7r1+b18/W3T15aTdCtuws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582163073; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=UZy9Ogg3+KySVfXVXLE8GpOVXomh+4oCXaaSxRIQR9o=; b=iuokPQ0e1gFc1nD49mRSBIbweJseEJeY1FBB8V+HAnNaQieHjpRAn+78qnfdZYsp9cRfz2rMdCrYtH/skVnMqv6oFUBn8SFQ6nlFCdrtl6xmWbRYbismbwQA7sKRfHJyoRLx+jKS+p/DsvOBF9BlIOngPvezHugWAlA32rbzsnw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54659+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 1582163073285666.7900822687066; Wed, 19 Feb 2020 17:44:33 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id PeRgYY1788612xH2TKP9jo4y; Wed, 19 Feb 2020 17:44:32 -0800 X-Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by mx.groups.io with SMTP id smtpd.web10.3544.1582163072020092495 for ; Wed, 19 Feb 2020 17:44:32 -0800 X-Received: by mail-pl1-f194.google.com with SMTP id y8so866767pll.13 for ; Wed, 19 Feb 2020 17:44:31 -0800 (PST) X-Gm-Message-State: 1pUvgL5c1J5mbds7nZIlyIxax1787277AA= X-Google-Smtp-Source: APXvYqzN7lv1+SgKCUXOUd/8IzKxYkWsofCwFq9mWcFMWlMtbOAtl1tlMA1fKi930ey+bxyKaXaQAA== X-Received: by 2002:a17:902:d683:: with SMTP id v3mr29193966ply.134.1582163071108; Wed, 19 Feb 2020 17:44:31 -0800 (PST) X-Received: from localhost.localdomain ([223.104.4.131]) by smtp.gmail.com with ESMTPSA id v4sm858258pff.174.2020.02.19.17.44.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 17:44:30 -0800 (PST) From: "GuoMinJ" To: devel@edk2.groups.io Cc: GuoMinJ Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Invalid index may be used. Date: Thu, 20 Feb 2020 09:41:56 +0800 Message-Id: <02ae08887ff10e981ee247a74ce2e89eb1a4d747.1582162590.git.newexplorerj@gmail.com> 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,newexplorerj@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582163072; bh=GoeduCkSVAxtcKn3KYu5vKJzkbuxbUgjS83NLQqBeUU=; h=Cc:Date:From:Reply-To:Subject:To; b=HWYIyJidlVHRcwr0IM0JIuSUm1mD21fNfLpPpbQSbSYnlz0YxXQq+hl/9prvtM9IKDx W7po44AAknA3rYRI3lu9YHZcnnkTHxrpZufm8QLMVO5ZCyBZC64w4XpAy/JnBEvr9IPT6 ElY3+UUJtlzXjOeWDMkts6YTsGbFPqbvKSM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2535 The UINT_TEST_STATUS and FAILURE_TYPE have used 0 as status, so use 0 as unknown is confused, remove it from array enumeration but keep it location in the array. Signed-off-by: GuoMinJ Reviewed-by: Bret Barkelew Reviewed-by: Michael D Kinney Reviewed-by: Shenglei Zhang --- .../Library/UnitTestResultReportLib/UnitTestResultReportLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestR= esultReportLib.c b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/Uni= tTestResultReportLib.c index 687a04f55d..eba68e330c 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultRe= portLib.c +++ b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultRe= portLib.c @@ -65,7 +65,7 @@ GetStringForUnitTestStatus ( { UINTN Index; =20 - for (Index =3D 0; Index < ARRAY_SIZE (mStatusStrings); Index++) { + for (Index =3D 0; Index < ARRAY_SIZE (mStatusStrings) - 1; Index++) { if (mStatusStrings[Index].Status =3D=3D Status) { // // Return string from matching entry @@ -87,7 +87,7 @@ GetStringForFailureType ( { UINTN Index; =20 - for (Index =3D 0; Index < ARRAY_SIZE (mFailureTypeStrings); Index++) { + for (Index =3D 0; Index < ARRAY_SIZE (mFailureTypeStrings) - 1; Index++)= { if (mFailureTypeStrings[Index].Type =3D=3D Failure) { // // Return string from matching entry --=20 2.17.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 (#54659): https://edk2.groups.io/g/devel/message/54659 Mute This Topic: https://groups.io/mt/71411719/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-