From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [COMMITTED] backends: Fix arm_machine_flag_name version string.
Date: Mon, 13 Nov 2023 22:57:07 +0100 [thread overview]
Message-ID: <20231113215707.1680971-1-mark@klomp.org> (raw)
arm_machine_flag_name checks the version byte and if not zero returns
a version string. There are only 5 versions defined. So check the
version byte is not larger.
* backends/arm_machineflagname.c (arm_machine_flag_name):
Check version <= 0, otherwise return NULL.
https://sourceware.org/bugzilla/show_bug.cgi?id=31058
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
backends/arm_machineflagname.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/arm_machineflagname.c b/backends/arm_machineflagname.c
index e93092ae..d700d5f4 100644
--- a/backends/arm_machineflagname.c
+++ b/backends/arm_machineflagname.c
@@ -48,7 +48,7 @@ arm_machine_flag_name (Elf64_Word orig, Elf64_Word *flagref)
"Version5 EABI",
};
*flagref &= ~((Elf64_Word) EF_ARM_EABIMASK);
- return vername[version - 1];
+ return version <= 5 ? vername[version - 1] : NULL;
}
switch (EF_ARM_EABI_VERSION (orig))
{
--
2.39.3
reply other threads:[~2023-11-13 21:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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-all 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=20231113215707.1680971-1-mark@klomp.org \
--to=mark@klomp.org \
--cc=elfutils-devel@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).