[Cluster-devel] [gfs2-utils PATCH 3/3] gfs2_edit: fix a segfault with file names > 255 bytes

Bob Peterson rpeterso at redhat.com
Wed Jul 17 15:59:50 UTC 2013


This patch fixes a segfault in gfs2_edit caused by trying to print
file names longer than 255 bytes.
---
 gfs2/edit/gfs2hex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 6979cd9..cc0ceb6 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -122,7 +122,7 @@ void eol(int col) /* end of line */
 void __attribute__((format (printf, 1, 2))) print_gfs2(const char *fmt, ...)
 {
 	va_list args;
-	char string[NAME_MAX];
+	char string[PATH_MAX];
 	
 	memset(string, 0, sizeof(string));
 	va_start(args, fmt);
-- 
1.8.3.1




More information about the Cluster-devel mailing list