From: "Darrick J. Wong" <djwong@kernel.org>
To: Boian Bonev <bbonev@ipacct.com>
Cc: linux-xfs@vger.kernel.org, bage@debian.org
Subject: Re: [PATCH] Avoid format truncation
Date: Mon, 15 Nov 2021 08:45:30 -0800 [thread overview]
Message-ID: <20211115164530.GF24307@magnolia> (raw)
In-Reply-To: <20211114211457.199710-1-bbonev@ipacct.com>
On Sun, Nov 14, 2021 at 11:14:58PM +0200, Boian Bonev wrote:
> io.c:644:17: note: ‘snprintf’ output between 4 and 14 bytes into a destination of size 8
>
> Signed-off-by: Boian Bonev <bbonev@ipacct.com>
I really hope nobody ever gets to a cursor depth of 4 billion, but the
logic is correct, so...
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> db/io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/db/io.c b/db/io.c
> index c79cf105..154c3bd9 100644
> --- a/db/io.c
> +++ b/db/io.c
> @@ -638,7 +638,7 @@ stack_f(
> char **argv)
> {
> int i;
> - char tagbuf[8];
> + char tagbuf[14];
>
> for (i = iocur_sp; i > 0; i--) {
> snprintf(tagbuf, sizeof(tagbuf), "%d: ", i);
> --
> 2.33.1
>
prev parent reply other threads:[~2021-11-15 16:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-14 21:14 [PATCH] Avoid format truncation Boian Bonev
2021-11-15 16:45 ` Darrick J. Wong [this message]
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=20211115164530.GF24307@magnolia \
--to=djwong@kernel.org \
--cc=bage@debian.org \
--cc=bbonev@ipacct.com \
--cc=linux-xfs@vger.kernel.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