From: "GuoMinJ" <newexplorerj@gmail.com>
To: devel@edk2.groups.io
Cc: GuoMinJ <newexplorerj@gmail.com>
Subject: [PATCH] MdeModulePkg/Application: Overflowed Array Index
Date: Thu, 20 Feb 2020 13:59:13 +0800 [thread overview]
Message-ID: <a2749fceff7210f8be290897d29d4a106214de42.1582175012.git.newexplorerj@gmail.com> (raw)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2272
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 <newexplorerj@gmail.com>
---
.../Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.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 >= 0 && Type <= ARRAY_SIZE(mUsbTypeString)) {
+ if (Type >= 0 && Type < ARRAY_SIZE(mUsbTypeString)) {
return mUsbTypeString[Type];
} else {
AsciiSPrint (mNameString, sizeof(mNameString), "0x%x", Type);
--
2.17.1
next reply other threads:[~2020-02-20 6:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 5:59 GuoMinJ [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-02-20 7:01 [PATCH] MdeModulePkg/Application: Overflowed Array Index GuoMinJ
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2749fceff7210f8be290897d29d4a106214de42.1582175012.git.newexplorerj@gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox