xfs
[Top] [All Lists]

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

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] xfstests: fix buffer overflow in lstat64.c
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 24 Nov 2008 11:39:16 -0500
Cc: xfs mailing list <xfs@xxxxxxxxxxx>
In-reply-to: <20081112095702.GA2496@xxxxxxxxxxxxx>
References: <490F7A7F.9010102@xxxxxxxxxxx> <20081112095702.GA2496@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
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@xxxxxx>

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]);

<Prev in Thread] Current Thread [Next in Thread>