From 4c4452f12207b7022847c71308ce026c67391cbe Mon Sep 17 00:00:00 2001
From: adilger <adilger>
Date: Wed, 12 Mar 2008 10:21:54 +0000
Subject: [PATCH] Branch b1_6 Fix a relatively harmless buffer overlow in "lfs
 df". b=15183 i=komal.nawandar i=green

---
 lustre/utils/lfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c
index 168759db1f..dba6a473c2 100644
--- a/lustre/utils/lfs.c
+++ b/lustre/utils/lfs.c
@@ -712,7 +712,8 @@ static int showdf(char *mntdir, struct obd_statfs *stat,
         long long avail, used, total;
         double ratio = 0;
         char *suffix = "KMGTPEZY";
-        char tbuf[10], ubuf[10], abuf[10], rbuf[10];
+        /* Note if we have >2^64 bytes/fs these buffers will need to be grown */
+        char tbuf[20], ubuf[20], abuf[20], rbuf[20];
 
         if (!uuid || !stat)
                 return -EINVAL;
-- 
GitLab