From nobody Sat May 4 19:57:39 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+54668+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+54668+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1582178484; cv=none; d=zohomail.com; s=zohoarc; b=dxc77S2Yas5zHdwWfoGbDmjnToOSA2wpFt0QicU4VwHGWW1fel61f0rLTtyk9mCl2dYzwa6yafX+uTY79372CVIxf8GHJVrrb7YipFZLlZaQw7tStIOhbbNfuDpDp7aCmZQ0Sje2s2UAyXhFNw36zG2MXR7G9Pn2/Tx2GABhDHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582178484; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To; bh=Oup31oncFHgUhZnp1t/RB8jIzC3WE7EUre1XjI6e6C8=; b=asVcBvoFjgL2MyeAr8AGDjJRVKPNLrbGbcj6TrPD/L5aniHTiOO3DGm9d4vYI4qoZBfV7nXlERT6am2YPc6hyua1ROWNOg/WWZ/KPXcCNyxlaCIh/ljCyQtcjYrce7lim1gtLxx8I8nsY20WYyqpvar0/giIZoBwkUeSnj485eU= 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+54668+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 1582178484312594.6367245324262; Wed, 19 Feb 2020 22:01:24 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id CuX5YY1788612xk1JmGPg7cX; Wed, 19 Feb 2020 22:01:23 -0800 X-Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by mx.groups.io with SMTP id smtpd.web11.1849.1582178483125539192 for ; Wed, 19 Feb 2020 22:01:23 -0800 X-Received: by mail-pl1-f196.google.com with SMTP id j7so1120230plt.1 for ; Wed, 19 Feb 2020 22:01:23 -0800 (PST) X-Gm-Message-State: RCbWftHcbuCoHPE2cuFgYFTVx1787277AA= X-Google-Smtp-Source: APXvYqw6gEEAApyX63wY9oywTKryFpoE2F1tZk4Pe3zbBitfRSzrVTMB3JmKlF8jm040CWcp6FgVkA== X-Received: by 2002:a17:90a:8001:: with SMTP id b1mr1662210pjn.39.1582178482233; Wed, 19 Feb 2020 22:01:22 -0800 (PST) X-Received: from localhost.localdomain ([223.104.4.131]) by smtp.gmail.com with ESMTPSA id h7sm1746908pfq.36.2020.02.19.22.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 22:01:21 -0800 (PST) From: "GuoMinJ" To: devel@edk2.groups.io Cc: GuoMinJ Subject: [edk2-devel] [PATCH] MdeModulePkg/Application: Overflowed Array Index Date: Thu, 20 Feb 2020 13:59:13 +0800 Message-Id: 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=1582178483; bh=g2J1z1OF1vkkCUDxGt492K5HpvIcQroHP09/899OzLM=; h=Cc:Date:From:Reply-To:Subject:To; b=une9hOJ+dCk5w8yj/Q7JAX55tEo640dUR5vtXG2y6mP4vT2+ZeBzun5xurHZ6DiXrS7 PGlohpUXudq64SPZAYIMW6Huccj4TFlupOYv10y1VuKZvVIoSHdzAHrBtjLs00mbfq2+c YsP12nW5VMXzikdHctalTjj37viaYnVjXeY= 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=3D2272 Index should be off-by one than size of array, so when check mUsbTypeString, the max index should less than size of array. Signed-off-by: GuoMinJ --- .../Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfi= leInfo.c b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfile= Info.c index 0f7163160b..f8afcd6f96 100644 --- a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c +++ b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c @@ -508,7 +508,7 @@ UsbTypeToString ( IN EFI_USB_SMI_TYPE Type ) { - if (Type >=3D 0 && Type <=3D ARRAY_SIZE(mUsbTypeString)) { + if (Type >=3D 0 && Type < ARRAY_SIZE(mUsbTypeString)) { return mUsbTypeString[Type]; } else { AsciiSPrint (mNameString, sizeof(mNameString), "0x%x", Type); --=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 (#54668): https://edk2.groups.io/g/devel/message/54668 Mute This Topic: https://groups.io/mt/71423321/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-