From: Jeff Layton <jlayton@kernel.org>
To: linux-sparse@vger.kernel.org
Cc: luc.vanoostenryck@gmail.com
Subject: [PATCH] linearize.c: fix potential buffer overrun
Date: Wed, 22 Feb 2023 10:52:44 -0500 [thread overview]
Message-ID: <20230222155244.133890-1-jlayton@kernel.org> (raw)
The resulting string won't be nearly 64 bytes, but "buf" is only 16
bytes long here, and this causes FORTIFY_SOURCE to barf when given the
right options.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
linearize.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linearize.c b/linearize.c
index d9aed61b361f..1db2d505a7d4 100644
--- a/linearize.c
+++ b/linearize.c
@@ -91,7 +91,7 @@ const char *show_label(struct basic_block *bb)
if (!bb)
return ".L???";
- snprintf(buf, 64, ".L%u", bb->nr);
+ snprintf(buf, 16, ".L%u", bb->nr);
return buf;
}
--
2.39.2
next reply other threads:[~2023-02-22 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 15:52 Jeff Layton [this message]
2023-12-18 13:56 ` [PATCH] linearize.c: fix potential buffer overrun Luc Van Oostenryck
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=20230222155244.133890-1-jlayton@kernel.org \
--to=jlayton@kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
/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).