[PATCH 2/2] xfs_db: fix a complaint about a printf buffer overrun

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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);




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux