[PATCH] xfstests: fix buffer overflow in lstat64.c

Christoph Hellwig hch at infradead.org
Mon Nov 24 10:39:16 CST 2008


On Wed, Nov 12, 2008 at 04:57:02AM -0500, Christoph Hellwig wrote:
> On Mon, Nov 03, 2008 at 04:26:07PM -0600, Eric Sandeen wrote:
> > lstat64.c was putting an 11-byte string into a 10-byte buffer.
> 
> What about somthing like this instead?

This actually broken xfstests, doh.  I don't quite know why, but we'll
need this little bit ontop:


Signed-off-by: Christoph Hellwig <hch at lst.de>

Index: xfs-cmds/xfstests/src/lstat64.c
===================================================================
--- xfs-cmds.orig/xfstests/src/lstat64.c	2008-11-24 22:06:47.000000000 +0530
+++ xfs-cmds/xfstests/src/lstat64.c	2008-11-24 22:06:53.000000000 +0530
@@ -77,7 +77,7 @@ main(int argc, char **argv)
 	time(&timebuf);
 
 	for (i = optind; i < argc; i++) {
-		char *mode = "----------";
+		char mode[] = "----------";
 
 		if( lstat64(argv[i], &sbuf) < 0) {
 			perror(argv[i]);



More information about the xfs mailing list