All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@sandeen.net, djwong@kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 2/2] xfs_db: fix a complaint about a printf buffer overrun
Date: Thu, 05 May 2022 09:04:10 -0700	[thread overview]
Message-ID: <165176665092.246897.6105158987030874479.stgit@magnolia> (raw)
In-Reply-To: <165176663972.246897.5479033385952013770.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

gcc 11 warns that stack_f doesn't allocate a sufficiently large buffer
to hold the printf output.  I don't think the io cursor stack is really
going to grow to 4 billion levels deep, but let's fix this anyway.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 db/io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/db/io.c b/db/io.c
index 98f4e605..bfc86cc4 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);


  parent reply	other threads:[~2022-05-05 16:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 16:03 [PATCHSET 0/2] xfsprogs: random fixes Darrick J. Wong
2022-05-05 16:04 ` [PATCH 1/2] xfs_scrub: move to mallinfo2 when available Darrick J. Wong
2022-05-05 19:28   ` Eric Sandeen
2022-05-10  9:38   ` Christoph Hellwig
2022-05-05 16:04 ` Darrick J. Wong [this message]
2022-05-05 19:34   ` [PATCH 2/2] xfs_db: fix a complaint about a printf buffer overrun Eric Sandeen
2022-05-10  9:38   ` Christoph Hellwig
2022-05-10 21:30 ` [PATCH 3/2] xfs: note the removal of XFS_IOC_FSSETDM in the documentation Darrick J. Wong
2022-05-12 18:31   ` Eric Sandeen

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=165176665092.246897.6105158987030874479.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.